make grpcmux pause/resume come in pair by returning a RAII obj which resumes requests on destruction.#11739
Conversation
Signed-off-by: Lizan Zhou <lizan@tetrate.io>
Signed-off-by: Xin Zhuang <stevenzzz@google.com>
Signed-off-by: Xin Zhuang <stevenzzz@google.com>
Signed-off-by: Xin Zhuang <stevenzzz@google.com>
Signed-off-by: Xin Zhuang <stevenzzz@google.com>
Signed-off-by: Xin Zhuang <stevenzzz@google.com>
…equests on destruction Signed-off-by: Xin Zhuang <stevenzzz@google.com>
Signed-off-by: Xin Zhuang <stevenzzz@google.com>
Signed-off-by: Xin Zhuang <stevenzzz@google.com>
|
PTAL cannot be assigned to this issue. |
|
/assign @htuch |
…l be happy Signed-off-by: Xin Zhuang <stevenzzz@google.com>
htuch
left a comment
There was a problem hiding this comment.
Thanks so much @stevenzzzz for this change, this is a huge improvement to making pause/resume more robust.
/wait
source/common/router/scoped_rds.cc
Outdated
| std::unique_ptr<Cleanup> resume_rds; | ||
| // NOTE: This should be defined after noop_init_manager and resume_rds, as it depends on the | ||
| // noop_init_manager, and we want a single RDS discovery request to be sent to management server. | ||
| std::unique_ptr<Cleanup> init_noop_init_manager; |
There was a problem hiding this comment.
Can you give this a clearer name? It's easy to confuse noop_init_manager and init_noop_init_manager when reading.
There was a problem hiding this comment.
how about disposable_init_mgr?
Signed-off-by: Xin Zhuang <stevenzzz@google.com>
|
thanks |
htuch
left a comment
There was a problem hiding this comment.
Looks good, a few minor comments.
/wait
source/common/router/scoped_rds.cc
Outdated
| // NOTE: This should be defined after noop_init_manager and resume_rds, as it depends on the | ||
| // noop_init_manager, and we want a single RDS discovery request to be sent to management server. | ||
| std::unique_ptr<Cleanup> init_noop_init_manager; | ||
| std::unique_ptr<Init::ManagerImpl> disposable_init_mgr; |
There was a problem hiding this comment.
Suggestion: call this srds_init_mgr
source/common/router/scoped_rds.cc
Outdated
| // NOTE: This should be defined after disposable_init_mgr and resume_rds, as it depends on the | ||
| // disposable_init_mgr, and we want a single RDS discovery request to be sent to management | ||
| // server. | ||
| std::unique_ptr<Cleanup> init_disposable_init_mgr; |
There was a problem hiding this comment.
Suggestion: call this srds_initialization_continuation
There was a problem hiding this comment.
done, indeed a better name.
| )EOF"; | ||
| Protobuf::RepeatedPtrField<ProtobufWkt::Any> resources; | ||
| parseScopedRouteConfigurationFromYaml(*resources.Add(), config_yaml); | ||
| init_watcher_.expectReady().Times(1); |
There was a problem hiding this comment.
Nit: Times(1) is redundant, that is the default.
Signed-off-by: Xin Zhuang <stevenzzz@google.com>
Signed-off-by: Xin Zhuang <stevenzzz@google.com>
Signed-off-by: Xin Zhuang <stevenzzz@google.com>
Signed-off-by: Xin Zhuang <stevenzzz@google.com>
|
/retest |
|
🤷♀️ nothing to rebuild. |
|
@stevenzzzz approved, but master merges are blocked until the security release tomorrow. I'm going to leave #11674 open still until we sort out the story with cluster manager and refcounts (can you comment there? thanks). |
|
sounds good
…On Mon, Jun 29, 2020 at 3:21 PM htuch ***@***.***> wrote:
@stevenzzzz <https://github.com/stevenzzzz> approved, but master merges
are blocked until the security release tomorrow. I'm going to leave #11674
<#11674> open still until we
sort out the story with cluster manager and refcounts (can you comment
there? thanks).
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#11739 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AA2I6TC3WUHVPGMTDZ2JQSDRZDSSFANCNFSM4OHKXBEQ>
.
--
Xin Zhuang
|
|
@stevenzzzz can you merge master? Thanks. |
Signed-off-by: Xin Zhuang <stevenzzz@google.com>
Signed-off-by: Xin Zhuang <stevenzzz@google.com>
Signed-off-by: Xin Zhuang <stevenzzz@google.com>
00817ed to
6e0a725
Compare
|
sorry, had a git problem locally, had to force push. |
htuch
left a comment
There was a problem hiding this comment.
@stevenzzzz LGTM, but there is some strange formatting in this PR (hence why I'm sure CI is failing). Can you fix_format?
Signed-off-by: Xin Zhuang <stevenzzz@google.com>
Signed-off-by: Xin Zhuang <stevenzzz@google.com>
Signed-off-by: Xin Zhuang <stevenzzz@google.com>
|
seems like a clang version problem, formatted using "tools/code_format/check_format.py fix" with clang10 now. |
|
/retest |
|
🤷♀️ nothing to rebuild. |
…resumes requests on destruction. (envoyproxy#11739) * doc: fix SNI FAQ link (envoyproxy#10227) Signed-off-by: Lizan Zhou <lizan@tetrate.io> * make api pause/resume in pair by returning a RAII obj which resumes requests on destruction Signed-off-by: Xin Zhuang <stevenzzz@google.com> * cancel resume_cds_ on shutdown of clustermanagerImpl Signed-off-by: Xin Zhuang <stevenzzz@google.com> * format errors fix Signed-off-by: Xin Zhuang <stevenzzz@google.com> * move the ABSL_MUST_USE_RESULT attr to the beginning to see if gcc will be happy Signed-off-by: Xin Zhuang <stevenzzz@google.com> * pass by reference type_urls into cleanup in scoped rds Signed-off-by: Xin Zhuang <stevenzzz@google.com> * review fixes per Harvey comments. Signed-off-by: Xin Zhuang <stevenzzz@google.com> * remove unused parameter, weird it wasnt caught previously Signed-off-by: Xin Zhuang <stevenzzz@google.com> * fix-format using clang 10 Signed-off-by: Xin Zhuang <stevenzzz@google.com> Co-authored-by: Lizan Zhou <lizan@tetrate.io> Signed-off-by: scheler <santosh.cheler@appdynamics.com>
make api pause/resume in pair by returning a RAII obj which resumes requests on destruction.
At present, the pause/resume appear in pair in most call sites, besides the clusterManagerImpl::updateClusterCounts(). this PR add some constraint to pause caller that they need to take care of the resume or the paused type-urls auto resume when the returned Cleanup is out of scope.
Ideally caller of Pause should always resume the resource when it's done, this is a step towards that goal.
Commit Message:
Additional Description:
Risk Level: low, mostly refactoring.
Testing: unit tests adjusted
Docs Changes: N/A
Release Notes: N/A
[Optional Runtime guard:]
[Optional Fixes #Issue] #11674