envoyproxy / envoy

Cloud-native high-performance edge/middle/service proxy
https://www.envoyproxy.io
Apache License 2.0
24.53k stars 4.73k forks source link

Draining `inboundonly` and `graceful` do not work together #35020

Open howardjohn opened 1 month ago

howardjohn commented 1 month ago

If you are reporting any crash or any potential security issue, do not open an issue in this repo. Please report the issue via emailing envoy-security@googlegroups.com where the issue will be triaged appropriately.

Title: Draining inboundonly and graceful do not work together

Description:

when draining listeners with inboundonly&graceful&skip_exit, the inboundonly attribute is ignored.

You can see here it is never used at all: https://github.com/envoyproxy/envoy/blob/277722e94187045bfe7da6d13d2835b5c5b14168/source/server/admin/listeners_handler.cc#L31-L43

Repro steps: curl httpbin.org/get -v and look for connection: close header. Note this goes through an outbound listener.

keithmattix commented 1 month ago

/assign @keithmattix

keithmattix commented 1 month ago

Update: the drain manager doesn't actually support uni-directional draining. This would be a new feature, but I think it's reasonable and somewhat simple to implement. I can potentially get a PR out in the next week or so

keithmattix commented 1 month ago

/cc @jmarantz what're your thoughts here? The draining semantics that I see in the code don't have any existing hooks for limiting the draining to only inbound listneners