Skip to content

Correctly shutdown HTTP2ConnectionPool if connection creation fails. #647

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

Conversation

dnadoba
Copy link
Collaborator

@dnadoba dnadoba commented Nov 8, 2022

Motivation

Previous code assumed that we were always in the running state. We therefore never transition from the shuttingDown to the shutDown state if the last connection in the pool fails.

Modifications

  • don't start new connection and instead correctly shutdown the pool if the last connection failed
  • add test which previously failed

Result

HTTPClient is correctly shut down if HTTP2 connections establishment fails while shut down is in progress.

Resolves #638

@dnadoba dnadoba added the 🔨 semver/patch No public API change. label Nov 8, 2022
@dnadoba dnadoba force-pushed the dn-switch-over-state-in-failed-to-create-new-connection branch from 933bb94 to 2cf3d0e Compare November 8, 2022 18:36
@dnadoba dnadoba requested a review from fabianfett November 9, 2022 13:17
@dnadoba dnadoba merged commit 5bee16a into swift-server:main Nov 9, 2022
@dnadoba dnadoba deleted the dn-switch-over-state-in-failed-to-create-new-connection branch November 9, 2022 14:30
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.

Switch over state in HTTPConnectionPool.HTTP2StateMachine.failedToCreateNewConnection
3 participants