Skip to content

[HTTP2] Tolerate GoAway and Settings frames after connection close #578

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

Merged
merged 1 commit into from
Apr 11, 2022

Conversation

fabianfett
Copy link
Member

Motivation

We may receive GoAway and Settings frames, even after a context.close() was issued. For this reason, we must not precondition on the close state in our HTTP2IdleHandler.StateMachine.

Changes

  • Allow GoAway and Settings frames to be received, after we have closed the connection from our perspective.

Result

Fixes #575.

@fabianfett fabianfett requested a review from Lukasa April 11, 2022 11:50
Comment on lines +262 to +265
case .closed:
// We may receive a events after we have called connection close, because of
// internal races. We should just ignore these cases.
return .nothing
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Lukasa Is this something that can happen? Should we be defensive here as well?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This can happen, yes, unless we take action to defend against it. As we don't right now, it's a good idea to do this.

@fabianfett fabianfett added the 🔨 semver/patch No public API change. label Apr 11, 2022
@fabianfett fabianfett merged commit d2da15c into swift-server:main Apr 11, 2022
@fabianfett fabianfett deleted the ff-tolerate-goaway branch April 11, 2022 14:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🔨 semver/patch No public API change.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Crash on 1.9.0: Precondition Failure in HTTP2IdleHandler
2 participants