drain manager: Make probabilistic drain configurable#11403
Conversation
Signed-off-by: Auni Ahsan <auni@google.com>
Signed-off-by: Auni Ahsan <auni@google.com>
Signed-off-by: Auni Ahsan <auni@google.com>
|
@mattklein123 wanted to get your thoughts on this before I add the docs and release notes. I added a bool that guards the probabilistic drain behaviour, but I've got two thoughts:
|
Signed-off-by: Auni Ahsan <auni@google.com>
Signed-off-by: Auni Ahsan <auni@google.com>
Signed-off-by: Auni Ahsan <auni@google.com>
Signed-off-by: Auni Ahsan <auni@google.com>
+1 agreed this seems more future proof.
For integration tests it seems reasonable to allow direct access, but I will defer to @alyssawilk on that (it might already be possible). |
Signed-off-by: Auni Ahsan <auni@google.com>
Signed-off-by: Auni Ahsan <auni@google.com>
Signed-off-by: Auni Ahsan <auni@google.com>
Signed-off-by: Auni Ahsan <auni@google.com>
|
I don't mind allowing direct access, but please be mindful of thread safety issues - I think accessing it after the server starts running would be problematic. |
I decided this was too complicated for this PR and just plumbed the other variable. I'll maybe try to get this to work on the side. |
Signed-off-by: Auni Ahsan <auni@google.com>
|
I'm going to assume this is still not ready for review as CI is red. Ping when it's ready for a pass! |
Signed-off-by: Auni Ahsan <auni@google.com>
Signed-off-by: Auni Ahsan <auni@google.com>
Signed-off-by: Auni Ahsan <auni@google.com>
Signed-off-by: Shikugawa <rei@tetrate.io> Signed-off-by: Auni Ahsan <auni@google.com>
Moving the choice of http or tcp connection pool from the router to the generic connection pool. This will allow pluggable connection pools to choose to do HTTP or TCP on their own, as well as getting rid of a bunch of ugly variant logic. Risk Level: medium (router refactor, ideally no-op) Testing: existing test pass Docs Changes: n/a Release Notes: n/a Signed-off-by: Alyssa Wilk <alyssar@chromium.org> Signed-off-by: Auni Ahsan <auni@google.com>
…nvoyproxy#11126) Commit Message: grpc-json: preserve http request method in `x-envoy-original-method` header so that applications have access to it. Additional Description: The grpc-json transcoder currently forwards HTTP path to applications via "x-envoy-original-path" header. We would find it useful if it also forwarded the HTTP method. Risk Level: Low Testing: Updated grpc-json-transcoder unit tests Docs Changes: Added docs Release Notes: Added release notes Signed-off-by: Phillip Huang <phillip@dropbox.com> Signed-off-by: Auni Ahsan <auni@google.com>
Signed-off-by: Alyssa Wilk <alyssar@chromium.org> Signed-off-by: Auni Ahsan <auni@google.com>
Signed-off-by: Auni Ahsan <auni@google.com>
Signed-off-by: Auni Ahsan <auni@google.com>
Signed-off-by: Auni Ahsan <auni@google.com>
|
OK @alyssawilk this is green. |
alyssawilk
left a comment
There was a problem hiding this comment.
Looks good! just a few comments from my end.
| parent_shutdown_time_ = parent_shutdown_time; | ||
| } | ||
| void setDrainStrategy(Server::DrainStrategy drain_strategy) { drain_strategy_ = drain_strategy; } | ||
| void setLogLevel(spdlog::level::level_enum log_level) { log_level_ = log_level; } |
There was a problem hiding this comment.
Haha, the diff makes it look weird, but I was trying to move setParentShutdownTime(std::chrono::seconds) in order to group all of the drain-related setters together.
| EXPECT_CALL(server_, healthCheckFailed()).Times(0); // Listener check will short-circuit | ||
| EXPECT_FALSE(drain_manager.drainClose()); | ||
| } | ||
| INSTANTIATE_TEST_SUITE_P(DrainGradually, DrainManagerImplTest, testing::Bool()); |
There was a problem hiding this comment.
Is DrainGradually the correct name for this? Perhaps DrainStrategies?
| signal_handling_enabled_(true), mutex_tracing_enabled_(false), cpuset_threads_(false), | ||
| fake_symbol_table_enabled_(false) {} | ||
| parent_shutdown_time_(900), drain_strategy_(Server::DrainStrategy::Gradual), | ||
| mode_(Server::Mode::Serve), hot_restart_disabled_(false), signal_handling_enabled_(true), |
There was a problem hiding this comment.
How are non-google users to configure this option?
There was a problem hiding this comment.
Assuming you're saying this config path is only used by Google?
I was sticking to YAGNI, don't add further complications to the config plane unless someone actually wants it. I'd be happy to add CLI options for this similar to the --drain-time-s, though I'd prefer to do that in a separate PR.
There was a problem hiding this comment.
It's pretty envoy-standard to land the configuration, release notes, and code changes in a single PR - I don't think it'll make this one too large to review.
There was a problem hiding this comment.
Done I think, I looked at similar PRs to try to make sure I updated the right spot everywhere, but I'm not sure if I missed anything or if the language is correct.
Signed-off-by: Auni Ahsan <auni@google.com>
Signed-off-by: Auni Ahsan <auni@google.com>
Signed-off-by: Auni Ahsan <auni@google.com>
Signed-off-by: Auni Ahsan <auni@google.com>
Signed-off-by: Auni Ahsan <auni@google.com>
Signed-off-by: Auni Ahsan <auni@google.com>
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s), but failed to run 2 pipeline(s). |
alyssawilk
left a comment
There was a problem hiding this comment.
LGTM from a code perspective. Will defer to @htuch on API
|
/lgtm api |
Add DrainStrategy enum to Options with Graceful and Immediate Disable probabilistic drain in DrainManager if DrainStrategy == Immediate Add integration tests Risk Level: Low. Testing: Integration tests, verify that the race condition from envoyproxy#11240 does not occur if the probabilistic drain is disabled. Signed-off-by: Auni Ahsan <auni@google.com> Signed-off-by: yashwant121 <yadavyashwant36@gmail.com>
Add DrainStrategy enum to Options with Graceful and Immediate Disable probabilistic drain in DrainManager if DrainStrategy == Immediate Add integration tests Risk Level: Low. Testing: Integration tests, verify that the race condition from envoyproxy#11240 does not occur if the probabilistic drain is disabled. Signed-off-by: Auni Ahsan <auni@google.com>
Add DrainStrategy enum to Options with Graceful and Immediate Disable probabilistic drain in DrainManager if DrainStrategy == Immediate Add integration tests Risk Level: Low. Testing: Integration tests, verify that the race condition from envoyproxy#11240 does not occur if the probabilistic drain is disabled. Signed-off-by: Auni Ahsan <auni@google.com> Signed-off-by: yashwant121 <yadavyashwant36@gmail.com>
GracefulandImmediateRisk Level: Low.
Testing: Integration tests, verify that the race condition from #11240 does not occur if the probabilistic drain is disabled.