Skip to content

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.

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

@LukasaLukasa 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!

@fabianfettfabianfett merged commit 0bce647 into swift-server:mainSep 22, 2021
@fabianfettfabianfett deleted the ff-fix-lock-problems branch September 22, 2021 14:47
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🔨 semver/patchNo public API change.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@fabianfett@Lukasa