You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(epoll, iouring, std): graceful shutdown waits for the HTTP/2 streams on the shared worker pool, and std for its h2c streams (celeris#759) (#808)
epoll, io_uring, adaptive: once shutdown begins, a loop or worker sends every HTTP/2 connection GOAWAY and keeps serving it until no stream on the shared HTTP/2 worker pool (an async route) has a handler running, a response in its write queue, or DATA waiting for WINDOW_UPDATE; the wait is bounded like epoll's send drain (the last Shutdown's budget while it is live, WriteTimeout while it is set, never less than 250 ms). Before, those streams' connections were closed under their handlers (unexpected EOF) and the OnShutdown hooks ran first.
During that wait the native engines accept no new connection (epoll closes its listener when shutdown begins, io_uring when the wait begins), and a stream the client opens above the GOAWAY's last-stream-id is refused with REFUSED_STREAM, never served; a refused stream is not touched after its RST_STREAM has put it back in the stream pool.
std: the Bridge counts the HTTP/2 requests in their handler, and the drain waits for them after http.Server.Shutdown, bounded by the drain's context, so the hooks no longer run while an h2c handler is still running.
Engine.Shutdown's and Server.Shutdown's docs say what the engines do now. Follow-ups: #820.
Fixes#759
0 commit comments