[cherrypick/v1.33] feature: inbound only graceful draining (#37873)#38331
Closed
keithmattix wants to merge 1 commit intoenvoyproxy:release/v1.33from
Closed
[cherrypick/v1.33] feature: inbound only graceful draining (#37873)#38331keithmattix wants to merge 1 commit intoenvoyproxy:release/v1.33from
keithmattix wants to merge 1 commit intoenvoyproxy:release/v1.33from
Conversation
Fixes envoyproxy#35020. The inbound_only query param for the drain_listeners admin endpoint doesn't work with the graceful query parameter. As a result, outbound listeners will send connection: close headers to upstreams which is undesired. This PR adds the ability for drain_manager to drain in a single direction. Prior to this change, the `inbound_only` query param on the [`drain_listeners` admin endpoint ](https://www.envoyproxy.io/docs/envoy/latest/operations/admin#operations-admin-interface-drain) only modified which listeners were stopped. If `graceful` is set, listeners of all directions are drained, regardless if `inbound_only` is set. If `skip_exit` is set, `inbound_only` has zero effect. This PR adds the ability to drain only inbound listeners, allowing outbound listeners to continue functioning as normal. This is useful in the Kubernetes sidecar use-case where outbound traffic should not set connection: close headers to the upstream. Risk Level: Medium fixes envoyproxy#35020 Signed-off-by: Keith Mattix II <keithmattix@microsoft.com>
Member
|
something has broken also we generally dont backport features /wait |
keithmattix
commented
Feb 8, 2025
| // This prevents us from double incrementing if listeners are stopped twice. | ||
| // This can happen if the admin endpoint is triggered for inbound_only and then | ||
| // all. | ||
| if (stopped_listener_tags_.find(listener_tag) == stopped_listener_tags_.end()) { |
Contributor
Author
There was a problem hiding this comment.
Check to see if this function can be called by two threads at the same time; the first tag may not be added to the map yet
Contributor
Author
|
We missed the Istio 1.25 release, so not going to try and cherry-pick this |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Cherry-pick of #37873 for release 1.33. I'm proposing a cherry-pick because this solves a significant problem for envoy sidecar users, particularly native sidecar users.
Commit Message:
Fixes #35020. The inbound_only query param for the drain_listeners admin endpoint doesn't work with the graceful query parameter. As a result, outbound listeners will send connection: close headers to upstreams which is undesired. This PR adds the ability for drain_manager to drain in a single direction.
Prior to this change, the
inbound_onlyqueryparam on the
drain_listenersadmin endpointonly modified which listeners were stopped. If
gracefulis set, listeners of all directions are drained, regardless ifinbound_onlyis set. Ifskip_exitis set,inbound_onlyhas zero effect. This PR adds the ability to drain only inbound listeners, allowing outbound listeners to continue functioning as normal. This is useful in the Kubernetes sidecar use-case where outbound traffic should not set connection: close headers to the upstream.Additional Description:
Risk Level:
Testing:
Docs Changes:
Release Notes:
Platform Specific Features:
[Optional Runtime guard:]
[Optional Fixes #Issue]
[Optional Fixes commit #PR or SHA]
[Optional Deprecated:]
[Optional API Considerations:]