Skip to content

feature: inbound only graceful draining#37873

Merged
yanavlasov merged 24 commits intoenvoyproxy:mainfrom
keithmattix:feature/inbound-only-graceful-draining
Feb 6, 2025
Merged

feature: inbound only graceful draining#37873
yanavlasov merged 24 commits intoenvoyproxy:mainfrom
keithmattix:feature/inbound-only-graceful-draining

Conversation

@keithmattix
Copy link
Copy Markdown
Contributor

@keithmattix keithmattix commented Jan 4, 2025

Commit Message:

Fixes https://github.com/envoyproxy/envoy/issues/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.

Additional Description: Prior to this change, the inbound_only query param on the drain_listeners admin endpoint 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
Testing:
Docs Changes:
Release Notes:
Platform Specific Features:
[Optional Runtime guard:]
[Optional Fixes #Issue]
[Optional Fixes commit #PR or SHA] fixes #35020
[Optional Deprecated:]
[Optional API Considerations:]

@repokitteh-read-only
Copy link
Copy Markdown

As a reminder, PRs marked as draft will not be automatically assigned reviewers,
or be handled by maintainer-oncall triage.

Please mark your PR as ready when you want it to be reviewed!

🐱

Caused by: #37873 was opened by keithmattix.

see: more, trace.

@keithmattix
Copy link
Copy Markdown
Contributor Author

keithmattix commented Jan 4, 2025

Fixes #35020

@keithmattix keithmattix changed the title Feature/inbound only graceful draining feature: inbound only graceful draining Jan 4, 2025
@keithmattix keithmattix marked this pull request as ready for review January 6, 2025 05:41
@keithmattix keithmattix force-pushed the feature/inbound-only-graceful-draining branch from cfa48b0 to 5bd97d9 Compare January 6, 2025 16:19
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.

Signed-off-by: Keith Mattix II <keithmattix@microsoft.com>
Signed-off-by: Keith Mattix II <keithmattix@microsoft.com>
Signed-off-by: Keith Mattix II <keithmattix@microsoft.com>
@keithmattix keithmattix force-pushed the feature/inbound-only-graceful-draining branch from 5bd97d9 to 18fa880 Compare January 6, 2025 18:20
Copy link
Copy Markdown
Contributor

@KBaichoo KBaichoo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for working on this -- few comments / questions:

  1. Was directional draining not working at all prior to this?
  2. Can you add release notes?
  3. Can you fillout the PR description
  4. Can you add an integration test draining inbound only listeners using the admin endpoint so we can have something testing this e2e.
  5. I think some other network filters support draining but probably don't support directionality, can those also be documented?

/wait

Signed-off-by: Keith Mattix II <keithmattix@microsoft.com>
Signed-off-by: Keith Mattix II <keithmattix@microsoft.com>
@keithmattix
Copy link
Copy Markdown
Contributor Author

Thank you for working on this -- few comments / questions:

1. Was directional draining not working at all prior to this?

2. Can you add release notes?

3. Can you fillout the PR description

4. Can you add an integration test draining inbound only listeners using the admin endpoint so we can have something testing this e2e.

5. I _think_ some other network filters support draining but probably don't support directionality, can those also be documented?

/wait

  1. Directional draining "worked" in the since that only inbound listeners were stopped, but the drain manager drained all listeners regardless of direction.
  2. Done
  3. Done
  4. Done
  5. Documented where? Can you expand a bit on the ask?

Signed-off-by: Keith Mattix II <keithmattix@microsoft.com>
Signed-off-by: Keith Mattix II <keithmattix@microsoft.com>
@keithmattix keithmattix requested a review from KBaichoo January 14, 2025 16:14
@jmarantz
Copy link
Copy Markdown
Contributor

needs main merge

/wait

Copy link
Copy Markdown
Contributor

@KBaichoo KBaichoo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for the delay, this mostly looks good. Thank you!

Documented where? Can you expand a bit on the ask?

According to https://www.envoyproxy.io/docs/envoy/latest/intro/arch_overview/operations/draining some other network filters
support draining (Redis, Mongo, Thrift) but wouldn't support this newly added directional component?

Maybe documented in https://www.envoyproxy.io/docs/envoy/latest/operations/admin#operations-admin-interface-drain?

/wait

Signed-off-by: Keith Mattix II <keithmattix@microsoft.com>
Signed-off-by: Keith Mattix II <keithmattix@microsoft.com>
Signed-off-by: Keith Mattix II <keithmattix@microsoft.com>
Signed-off-by: Keith Mattix II <keithmattix@microsoft.com>
@keithmattix keithmattix requested a review from KBaichoo January 23, 2025 22:22
Signed-off-by: Keith Mattix II <keithmattix@microsoft.com>
@keithmattix
Copy link
Copy Markdown
Contributor Author

@KBaichoo I think this is ready for another round of review; thanks for the comments!

Signed-off-by: Keith Mattix II <keithmattix@microsoft.com>
Copy link
Copy Markdown
Contributor

@KBaichoo KBaichoo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks great. Few small comments, almost there. Thank you.

/wait

Signed-off-by: Keith Mattix II <keithmattix@microsoft.com>
Signed-off-by: Keith Mattix II <keithmattix@microsoft.com>
Signed-off-by: Keith Mattix II <keithmattix@microsoft.com>
@keithmattix
Copy link
Copy Markdown
Contributor Author

/retest

Copy link
Copy Markdown
Contributor

@KBaichoo KBaichoo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you LGTM.

/assign @ggreenway

for senior maintainer pass

@alyssawilk
Copy link
Copy Markdown
Contributor

@ggreenway ping?

@KBaichoo KBaichoo assigned yanavlasov and unassigned ggreenway Feb 4, 2025
@yanavlasov yanavlasov merged commit 916594d into envoyproxy:main Feb 6, 2025
keithmattix added a commit to keithmattix/envoy that referenced this pull request Feb 6, 2025
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>
phlax added a commit to phlax/envoy that referenced this pull request Feb 6, 2025
This reverts commit 916594d.

Signed-off-by: Ryan Northey <ryan@synca.io>
phlax added a commit to phlax/envoy that referenced this pull request Feb 6, 2025
This reverts commit 916594d.

Signed-off-by: Ryan Northey <ryan@synca.io>
phlax added a commit that referenced this pull request Feb 6, 2025
Fix #38330

Signed-off-by: Ryan Northey <ryan@synca.io>
yanavlasov pushed a commit that referenced this pull request Mar 4, 2025
Trying #37873 again to get to the bottom of the flakes that caused us to
need to revert. This got a lot more complex after #38333, so I may need
@yanavlasov to help me out with the proper semantics

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.
```
Additional Description:
Risk Level: Medium
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](https://github.com/envoyproxy/envoy/blob/main/api/review_checklist.md):]

---------

Signed-off-by: Keith Mattix II <keithmattix@microsoft.com>
alam0rt pushed a commit to alam0rt/envoy that referenced this pull request Mar 14, 2025
Trying envoyproxy#37873 again to get to the bottom of the flakes that caused us to
need to revert. This got a lot more complex after envoyproxy#38333, so I may need
@yanavlasov to help me out with the proper semantics

Commit Message:
```
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.
```
Additional Description:
Risk Level: Medium
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](https://github.com/envoyproxy/envoy/blob/main/api/review_checklist.md):]

---------

Signed-off-by: Keith Mattix II <keithmattix@microsoft.com>
jewertow pushed a commit to jewertow/envoy that referenced this pull request Apr 2, 2025
Trying envoyproxy#37873 again to get to the bottom of the flakes that caused us to
need to revert. This got a lot more complex after envoyproxy#38333, so I may need
@yanavlasov to help me out with the proper semantics

Commit Message: 
```
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.
```
Additional Description:
Risk Level: Medium
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](https://github.com/envoyproxy/envoy/blob/main/api/review_checklist.md):]

---------

Signed-off-by: Keith Mattix II <keithmattix@microsoft.com>
agrawroh pushed a commit to agrawroh/envoy that referenced this pull request Apr 9, 2025
Trying envoyproxy#37873 again to get to the bottom of the flakes that caused us to
need to revert. This got a lot more complex after envoyproxy#38333, so I may need
@yanavlasov to help me out with the proper semantics

Commit Message: 
```
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.
```
Additional Description:
Risk Level: Medium
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](https://github.com/envoyproxy/envoy/blob/main/api/review_checklist.md):]

---------

Signed-off-by: Keith Mattix II <keithmattix@microsoft.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Draining inboundonly and graceful do not work together

7 participants