HTTP/2 avoid closing connection when writing GOAWAY#9227
Merged
Scottmitch merged 1 commit intonetty:4.1from Jun 7, 2019
Merged
HTTP/2 avoid closing connection when writing GOAWAY#9227Scottmitch merged 1 commit intonetty:4.1from
Scottmitch merged 1 commit intonetty:4.1from
Conversation
Motivation: b4e3c12 introduced code to avoid coupling close() to graceful close. It also added some code which attempted to infer when a graceful close was being done in writing of a GOAWAY to preserve the "connection is closed when all streams are closed behavior" for the child channel API. However the implementation was too overzealous and may preemptively close the connection if there are not currently any open streams (and close if there are any frames which create streams in flight). Modifications: - Decouple writing a GOAWAY from trying to infer if a graceful close is being done and closing the connection. Even if we could enhance this logic (e.g. wait to close until the second GOAWAY with no error) it is possible the user doesn't want the connection to be closed yet. We can add a means for the codec to orchestrate the graceful close in the future (e.g. write some special "close the connection when all streams are closed") but for now we can just let the application handle this. Result: Fixes netty#9207
24c394d to
5afc095
Compare
ejona86
approved these changes
Jun 6, 2019
normanmaurer
approved these changes
Jun 6, 2019
Member
|
@netty-bot test this please |
Scottmitch
added a commit
that referenced
this pull request
Jun 7, 2019
Motivation: b4e3c12 introduced code to avoid coupling close() to graceful close. It also added some code which attempted to infer when a graceful close was being done in writing of a GOAWAY to preserve the "connection is closed when all streams are closed behavior" for the child channel API. However the implementation was too overzealous and may preemptively close the connection if there are not currently any open streams (and close if there are any frames which create streams in flight). Modifications: - Decouple writing a GOAWAY from trying to infer if a graceful close is being done and closing the connection. Even if we could enhance this logic (e.g. wait to close until the second GOAWAY with no error) it is possible the user doesn't want the connection to be closed yet. We can add a means for the codec to orchestrate the graceful close in the future (e.g. write some special "close the connection when all streams are closed") but for now we can just let the application handle this. Result: Fixes #9207
Member
Author
|
master (e0bfc4f) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation:
b4e3c12 introduced code to avoid coupling
close() to graceful close. It also added some code which attempted to infer when
a graceful close was being done in writing of a GOAWAY to preserve the
"connection is closed when all streams are closed behavior" for the child
channel API. However the implementation was too overzealous and may preemptively
close the connection if there are not currently any open streams (and close if
there are any frames which create streams in flight).
Modifications:
done and closing the connection. Even if we could enhance this logic (e.g.
wait to close until the second GOAWAY with no error) it is possible the user
doesn't want the connection to be closed yet. We can add a means for the codec
to orchestrate the graceful close in the future (e.g. write some special "close
the connection when all streams are closed") but for now we can just let the
application handle this.
Result:
Fixes #9207