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

Fixes #11763 - Race condition in QoSHandler. #11772

Merged
merged 2 commits into from May 14, 2024

Conversation

sbordet
Copy link
Contributor

@sbordet sbordet commented May 9, 2024

Now using a read-write lock to atomically execute expire().
This guarantees that there are no races with resume().

The concurrency between handle() and resume(), which should be the most common case, is handled by concurrent data structures.

Now using a read-write lock to atomically execute expire().
This guarantees that there are no races with resume().

The concurrency between handle() and resume(), which should be the most common case, is handled by atomic data structures.

Signed-off-by: Simone Bordet <[email protected]>
@sbordet sbordet requested review from gregw and lorban May 9, 2024 09:01
@sbordet sbordet linked an issue May 9, 2024 that may be closed by this pull request
lorban
lorban previously approved these changes May 9, 2024
Copy link
Contributor

@gregw gregw left a comment

Choose a reason for hiding this comment

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

I've found that if one synchronization mechanism doesn't prevent a race, then it is rarely fixed by adding yet another. The use of read/write lock and an atomic is strange and a bit confusing. I think I understand what it is doing, but at the very least it needs a lot more javadoc explaining the race and how this fixes it.

@sbordet sbordet merged commit a9b2da5 into jetty-12.0.x May 14, 2024
10 checks passed
@sbordet sbordet deleted the fix/jetty-12/11763/qoshandler-race branch May 14, 2024 08:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: ✅ Done
Development

Successfully merging this pull request may close these issues.

Race condition in QoSHandler
3 participants