-
Notifications
You must be signed in to change notification settings - Fork 62
ignore ping frame when connection is closed #184
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
base: main
Are you sure you want to change the base?
Conversation
while it's valid to process ping frames after sending/receiving goaway frames, preparing an AC frame may inadvertedly put bytes on the user buffer, thereby signaling that there's something to write back instead of terminating the connection
c00d937 to
8cdb4b7
Compare
8cdb4b7 to
dd1e475
Compare
this causes the truffleruby build to fail, as it expects to either receive a ping ack or have the connection closed
d4e74e9 to
33054ed
Compare
|
I'm definitely not a subject matter expert in HTTP2 but taking a dive into the specification, I think this is wrong.
I read this as - you must respond back to PING regardless of the situation and it should be at highest priority (e.g. it supersedes the GOAWAY frame). Is there a different or underlying fix that can be made to prevent those extra bytes or perhaps it is just the responsibility of the client to flush those? I think that after GOAWAY we can't just assume the connection is closed and done, we have to continue to do some house keeping until it's fully shut down. |
|
thx @mullermp ! I also read that section, and where I'm a bit on the fence here is on what to do when the receiver sees the frames in that particular order:
While we definitely have that issue at the frame emission level ( |
I think this is the fundamental problem. GOAWAY means to stop creating new streams. When the client receives GOAWAY, instead of shutting down the socket, the connection should be moved to a closing state. Then process the rest of the control frames (ping ack) then shut down the socket. Reading GOAWAY:
phrases such as "initiate shutdown" and "gracefully stop" and "administrative actions" I think indicate that we should not be immediately terminating the connection on that frame. |
while it's valid to process ping frames after sending/receiving goaway frames, preparing an AC frame may inadvertedly put bytes on the user buffer, thereby signaling that there's something to write back instead of terminating the connection,\
@igrigorik @mullermp would like to ask you guidance on this one. The RFC is not specific on what to do when receiving a PING frame after receiving a GOAWAY frame with stream id 0. I found at least one instance of a server which does exactly that, which led to some corruption on a long lived client connection, and while I can theoretically work around it on the client side in order to wipe out the buffer when processing a ping ack frame on a closed connection, that seems to be redundant and something the parser should do for me.