-
Notifications
You must be signed in to change notification settings - Fork 63
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
receiving ping while closing connection causing ProtocolError #139
Comments
Hmm, I think this is an implementation decision that we need to revisit on our end. Specifically, the problem here is that we transition to Relevant spec section: https://tools.ietf.org/html/rfc7540#section-6.8
A similar instance of same problem is in handling (recently) closed streams: |
I see. What do you suggest as the best approach then? Should one ignore all frames after a connection has been closed, or is there anything one needs to account for? |
I think the answer lies in the second paragraph I quoted. We shouldn't accept frames without raising an error indefinitely. We need to allow a small window (similar to what we did for |
I see. So the "15 second timeout" is not something enforced by the spec, rather a mitigation for this type of issue? |
No, that's an arbitrary timeout we picked for our implementation. The spec points out that this is a problem implementers should consider, but defers the implementation details. |
I've ran into the case where my connection receives a ping frame just after I call
goaway
on it. More or less this sequence:this happens due to this code here (after calling
goaway
on a connection,@state
is marked as:closed
).I was looking into the RFC, and couldn't figure out if this was a strict check besides
An endpoint MUST NOT send frames other than PRIORITY on a closed stream.
, which in my case the sender doesn't know, as the goaway frame has only been buffered, not sent yet. On the other hand, this only happens because I'm draining the socket and reacting on every frame, instead of draining socket then doing stuff like closing the connection. Is this something that the library could potentially figure out?The text was updated successfully, but these errors were encountered: