Skip to content

[HTTPConnectionPool] Fix timer action races #434

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 2 commits into from
Sep 22, 2021

Conversation

fabianfett
Copy link
Member

Motivation

We have a race between some actions created in the state machine under the stateLock and their implementation in the HTTPConnectionPool.

Changes

  • _idleTimer and _backoffTimer are protected by stateLock
  • Added a new struct Actions that splits up actions from the state machine into actions that need to be executed inside the stateLock and outside in stateLock

Result

No more races in timer scheduling.

@fabianfett fabianfett changed the title [HTTPConnectionPool] Fix race conditions [HTTPConnectionPool] Fix timer action races Sep 22, 2021
@fabianfett fabianfett added the 🔨 semver/patch No public API change. label Sep 22, 2021
@fabianfett fabianfett added this to the HTTP/2 support milestone Sep 22, 2021
Copy link
Collaborator

@Lukasa Lukasa left a comment

Choose a reason for hiding this comment

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

Great fix, nice work!

@fabianfett fabianfett merged commit 0bce647 into swift-server:main Sep 22, 2021
@fabianfett fabianfett deleted the ff-fix-lock-problems branch September 22, 2021 14:47
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.

2 participants