-
-
Notifications
You must be signed in to change notification settings - Fork 15.8k
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
HTTP/2 send goaway with error condition must close tcp connection #3653
Comments
@Scottmitch I'm not sure this gets us out of the woods. Consider this scenario:
This doesn't involve GO_AWAY at all. |
Yes there will be legitimate race conditions to deal with however I would like to explore if the following code (or something similar) is "sufficient" to ignore a frame due to these sequencing / race condition scenarios: private boolean streamMayHaveExisted(int streamId) {
return connection.remote().createdStreamId(streamId) && streamId < connection.remote().nextStreamId();
} If we feel that we should be returning errors after some "time" then we should keep some form of history. Possibly just in a limited capacity as suggested by @buchgr #3557 (comment). |
@Scottmitch wouldn't you need to check both endpoints, not just remote? |
@Scottmitch +1 |
@nmittler - That is a good point. I will think through the details but I'll submit a PR with this type of "simple" checks...and also explore "simple history" for problem streams. |
@Scottmitch since you seem to have looked into the details of the spec regarding this issue, could you please summarize in a short post what's the required behavior for every case and what's no required (just in like 5 bullet points). I have kinda lost track of when we have to send a RST_STREAM frame, when we have to close the connection and when we have to ignore a frame and such ... thanks! |
@Scottmitch @ejona86 @buchgr I was thinking how we might add the concept of interface ConnectionHistory {
enum StreamHistory {
CLOSED_NORMALLY,
RESET_SENT,
RESET_RECEIVED
}
// Not sure if we still need this if we're maintaining closeState.
boolean streamMayHaveExisted(int streamId);
StreamHistory streamHistory(int streamId);
} The implementation will be in the This should help us resolve the issues in the encoder and decoder WRT closed streams. Stream History and Flow Control ... :/The only problem that still remains is to figure out what flow controllers should do for absent streams. Right now the flow controller interfaces require a To simplify things, we could make |
@nmittler that all sounds good to me. No allocations yay :-). don't have a good solution for the flow controller atm either. all a bit hacky :\ |
@Scottmitch I'd could try throwing together a PR for this to see what it looks like ... WDYT? |
@nmittler - Sorry for the delayed response. I'm still wondering if we need the history. I'm going to switch gears back into this topic shortly but I think keeping history for every stream may be overkill. Is the primary motivator for keeping history to be able to know when receiving a frame associated with a stream we don't have an object allocated for an error or not? If so I would still like to explore the approach described in #3653 (comment) (ignore frames for streams that "may" have existed). If we can tolerate "ignoring" frames for streams that "may have existed" this may reduce the amount of work we have to do for the majority of the use cases. WDYT? |
I have a PR pending for this... |
Motivation: The specification requires that sending a GO_AWAY frame with an error code results in closing the TCP connection https://tools.ietf.org/html/draft-ietf-httpbis-http2-17#section-5.4.1. Modifications: - Close the connection after succesfully sending a GO_AWAY. Result: Fixes netty#3653
Motivation: The specification requires that sending a GO_AWAY frame with an error code results in closing the TCP connection https://tools.ietf.org/html/draft-ietf-httpbis-http2-17#section-5.4.1. Modifications: - Close the connection after succesfully sending a GO_AWAY. Result: Fixes netty#3653
Motivation: The specification requires that sending a GO_AWAY frame with an error code results in closing the TCP connection https://tools.ietf.org/html/draft-ietf-httpbis-http2-17#section-5.4.1. Modifications: - Close the connection after succesfully sending a GO_AWAY. Result: Fixes #3653
section 5.4.1:
We should update the life cycle manager's
goAway
documentation such that upon successful go away the channel must be closed. TheHtto2ConnectionHandler
should also be updated to implement this.The text was updated successfully, but these errors were encountered: