Skip to content
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

Fix potential race conditions when cancelling read/write idle timers #720

Merged
merged 2 commits into from
Dec 18, 2023

Conversation

gjcairo
Copy link
Collaborator

@gjcairo gjcairo commented Dec 18, 2023

Motivation

This PR is a follow-up to #718. It applies the same modifications done in #455 to the HTTP2 request handler to avoid a race condition when cancelling idle timers.

Modifications

A new timer ID for each timer (read and write idle timeouts) has been added to keep track of the current idle timers, just like it's done in the HTTP1 implementation.

Result

No more race conditions when cancelling timers in HTTP2.

@gjcairo gjcairo requested a review from dnadoba December 18, 2023 12:13
@gjcairo gjcairo added the semver/patch For PRs that when merged will only cause a bump of the patch version, ie. 1.0.x -> 1.0.(x+1) label Dec 18, 2023
@gjcairo gjcairo marked this pull request as ready for review December 18, 2023 12:14
Copy link
Collaborator

@dnadoba dnadoba left a comment

Choose a reason for hiding this comment

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

Perfect! Thanks for taking care of this

@gjcairo gjcairo merged commit ffe36fc into swift-server:main Dec 18, 2023
7 of 8 checks passed
@gjcairo gjcairo deleted the race-condition branch December 18, 2023 13:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
semver/patch For PRs that when merged will only cause a bump of the patch version, ie. 1.0.x -> 1.0.(x+1)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants