Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Drain HTTP connections more gracefully at shutdown #86983

Closed
DaveCTurner opened this issue May 20, 2022 · 2 comments
Closed

Drain HTTP connections more gracefully at shutdown #86983

DaveCTurner opened this issue May 20, 2022 · 2 comments
Labels
:Distributed Coordination/Network Http and internode communication implementations >enhancement Team:Distributed (Obsolete) Meta label for distributed team (obsolete). Replaced by Distributed Indexing/Coordination. >tech debt

Comments

@DaveCTurner
Copy link
Contributor

Description

Today when a node receives a SIGTERM we stop the HttpServerTransport which simply closes any inbound HTTP connections, regardless of the state they're in. This means that stopping a node will result in a small spike in error responses, which means a rolling restart is not truly a "zero-downtime" operation and carries some risk.

Instead I think we should stop accepting new connections and allow some time for in-flight requests to complete before closing existing connections. We'd send reponses in this phase with the Connection: close header indicating that the connection cannot be re-used for subsequent requests.

Note that this would still be something of a best-effort thing: a client may continue to send requests after the one that received the Connection: close response (e.g. if using pipelining) or the connection may be idle (so there's no response to which to attach the Connection: close header). It would still improve things in practice tho.

@DaveCTurner DaveCTurner added >enhancement :Distributed Coordination/Network Http and internode communication implementations labels May 20, 2022
@elasticmachine elasticmachine added the Team:Distributed (Obsolete) Meta label for distributed team (obsolete). Replaced by Distributed Indexing/Coordination. label May 20, 2022
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-distributed (Team:Distributed)

@stu-elastic
Copy link
Contributor

Fixed by #96363

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:Distributed Coordination/Network Http and internode communication implementations >enhancement Team:Distributed (Obsolete) Meta label for distributed team (obsolete). Replaced by Distributed Indexing/Coordination. >tech debt
Projects
None yet
Development

No branches or pull requests

4 participants