hasura / hasura/graphql-engine
Graceful shutdown blocked by Keep-Alive connections
- Dominant language
- TypeScript
- Stars
- 32.1k
- Forks
- 3k
- PR merge metrics
- PR metrics pending
Description
The idea behind graceful shutdown is that when shutting down graphql-engine, 1. it stops accepting requests, 2. it handles in-flight requests 3. it exits.
Due to a bug in the underlying web server https://github.com/yesodweb/wai/issues/853, in step 1 instead of stopping to accept requests, it only stops accepting new connections, but keeps accepting requests on any open keep-alive HTTP connections, until shutting down forcibly after the graceful shutdown timeout of 30s.
(Essentially, this is a duplicate of #2698, we might opt to reopen that ticket instead. Not sure how that should be handled.)
### Version Information
Server Version: current HEAD
### Environment
any
### What is the expected behaviour?
- If graphql-engine is interrupted while there are idle connections but no in-flight requests, it should exit more or less immediately, not wait for the graceful shutdown timeout of 30s.
- After graphql-engine is interrupted, it should not accept requests on existing HTTP connections.
### Keywords
Keep-Alive, HTTP, shutdown
### Any possible solutions?
This should ideally be fixed upstream in Warp, and then we should upgrade to that version.
Contributor guide
Assessment
This issue has not been assessed yet.