-
-
Notifications
You must be signed in to change notification settings - Fork 289
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
Current handling of GOAWAY is pretty broken #83
Comments
Handling GOAWAY is a complicated mess. A GOAWAY frame does not necessarily mean the connection is terminating (now or even that soon). It contains a reason, and a last stream ID. The connection should continue to try to process frames for any stream below the listed stream ID, and not make any new streams. It seems a graceful shutdown involves one side sending a GOAWAY, both sides finishing up the existing streams until EOS, and then the other side sends GOAWAY, and the connection terminates.
|
When receiving a GOAWAY. I would add that all streams higher than the reported stream ID should behave the same as if they received a RST_STREAM. Specifically, the GOAWAY reason is bubbled up to the stream handles.
I'd say the same thing that happens if there wasn't a GOAWAY frame before hand. (probably the same thing that happens now?) When sending
Do you have links in the spec? As in, shouldn't all "recoverable" errors result in a RST_STREAM? Or are there errors that are "semi" recoverable? Aka, no new streams but existing streams can complete? |
For instance, in the idle state:
We have to send a |
@seanmonstar but, I don't follow where in the spec it describes that a connection error of type |
Good news, the spec is confusing! My initial understanding was wrong, connection errors should close the socket after sending GOAWAY:
Confusion comes from the GOAWAY section:
I'm going to assume then this means |
@seanmonstar I don't know if I would make the For example, I would assume that if a server detects many connections from a single IP, it could send GOAWAY w/ |
So for now then, I'll assume to try for graceful shutdown no matter the error code, and allow the remote to hang up if it didn't want to shutdown gracefully. It seems that is what the spec suggests to do. As I implement this, I'm left with a couple of questions due to ambiguity, so I'll air them out here:
|
|
I'd say GOAWAY is no longer "pretty broken". It will try to finish up streams and then close up when done. It doesn't have a way for a user to initiate graceful shutdown yet, but I'd actually say that is a different issue. I'm therefore thinking this could be closed, and new issues could opened:
There is already an open issue to add a way to tell a server to close up on idle: #69. |
Right now,
GOAWAY
is interpreted as a signal to reset all streams. This, however, is not correct behavior.The text was updated successfully, but these errors were encountered: