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
Currently, when an HTTP/2 server connection enters graceful shutdown (after sending GOAWAY), it always waits for the full connectionDrainDuration before closing the connection, even if there are no active requests. This leads to unnecessary resource consumption and slower connection cleanup during server shutdown or connection recycling scenarios.
Current behavior
Server sends initial GOAWAY frame with stream ID Integer.MAX_VALUE to signal imminent shutdown
Waits for the full drain duration
Sends final GOAWAY and closes connection
Proposed Improvement
Implement an event-driven mechanism to close HTTP/2 connections immediately when no active requests remain during the drain phase. This would:
Track active requests during connection draining
Fire an event when the last active request completes (or immediately if no requests are active when draining starts)
Cancel the scheduled drain timeout and close the connection early
Please let me know if my understanding is correct and if the proposal is reasonbale!