Skip to content

fix race condition in httpcluster #41

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 3 commits into from
May 28, 2025
Merged

fix race condition in httpcluster #41

merged 3 commits into from
May 28, 2025

Conversation

robbyt
Copy link
Owner

@robbyt robbyt commented May 28, 2025

When rapidly unbinding/rebinding ports, there's a potential race condition when trying to bind to a port that is still being released by the OS. To work around this, I added a small delay as restartDelay after stopping, which isn't ideal- but it's a simpler alternative than testing if the port is freed before continuing.

This also updates the way that an entries change set is created by adding a new interface method buildPendingEntries that does a 'copy-on-write', returning an updated copy of itself, with the actions updated and any changes specified in the method input. It also changes the entries constructor to simplify it, previously it would take the new and old set of entries, updating them- this complexity was moved to buildPendingEntries.

This change also includes many adjustments to tests.

Copy link

github-actions bot commented May 28, 2025

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

Scanned Files

None

@robbyt robbyt force-pushed the rterhaar/httpcluster-race branch from 3a68cb5 to 80db02a Compare May 28, 2025 21:40
Copy link

Quality Gate Failed Quality Gate failed

Failed conditions
70.1% Coverage on New Code (required ≥ 80%)

See analysis details on SonarQube Cloud

@robbyt robbyt merged commit 47b2bbe into main May 28, 2025
4 of 5 checks passed
@robbyt robbyt deleted the rterhaar/httpcluster-race branch May 28, 2025 21:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant