Skip to content

Draining inboundonly and graceful do not work together #35020

@howardjohn

Description

@howardjohn

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:

if (graceful) {
// Ignore calls to /drain_listeners?graceful if the drain sequence has
// already started.
if (!server_.drainManager().draining()) {
server_.drainManager().startDrainSequence([this, stop_listeners_type, skip_exit]() {
if (!skip_exit) {
server_.listenerManager().stopListeners(stop_listeners_type, {});
}
});
}
} else {
server_.listenerManager().stopListeners(stop_listeners_type, {});
}

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

  • Before: no close.
  • curl -X POST localhost:15000/'drain_listeners?inboundonly: no close header set
  • curl -X POST localhost:15000/'drain_listeners?inboundonly&graceful&skip_exit: close header is set unexpectedly

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions