Implement two-phase graceful HTTP/2 shutdown#654
Implement two-phase graceful HTTP/2 shutdown#654arturobernalg wants to merge 1 commit intoapache:masterfrom
Conversation
Send an initial GOAWAY, wait one RTT using PING, then send the final GOAWAY with the last processed stream id.
|
@arturobernalg Why is this needed? What does this improve excactly? |
@ok2c https://www.rfc-editor.org/rfc/rfc9113.html#section-6.8 “A server that is attempting to gracefully shut down a connection SHOULD send an initial GOAWAY frame with the last stream identifier set to 2^31-1 and a NO_ERROR code.” “After allowing time for any in-flight stream creation (at least one round-trip time), the server MAY send another GOAWAY frame with an updated last stream identifier.” |
@arturobernalg Very well. A server. And what about clients? Does this make any sense for client connections? |
Good point.For client connections, sending GOAWAY on graceful close still makes sense, but the two-phase drain logic appears to have much less practical value except perhaps for server push. |
|
@arturobernalg What I was trying to say this feature would make more sense for the server side and so much for the client side, where it would just slow down connection termination. It may still be worth looking at but for the server side only. |
|
Hi @ok2c I updated the patch to restrict the two-phase graceful shutdown logic to server-side connections only. |
This change implements two-phase graceful shutdown for HTTP/2 connections.
The multiplexer sends an initial GOAWAY, waits one RTT using PING, then sends the final GOAWAY with the last processed stream identifier while continuing to handle in-flight peer streams and peer GOAWAY boundaries correctly.