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: avoid underflow of the queued_tasks metric #1628

Merged
merged 2 commits into from
Nov 13, 2024

Conversation

pjenvey
Copy link
Member

@pjenvey pjenvey commented Nov 5, 2024

I almost just caught the specific underflow case active_threads.load(Ordering::Relaxed).min(spawned_tasks) but I think SeqCst should also avoid this.

Closes SYNC-4475

@pjenvey pjenvey requested review from jrconlin and taddes November 5, 2024 20:11
Copy link
Member

@jrconlin jrconlin left a comment

Choose a reason for hiding this comment

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

I agree that SeqCst is preferable in this case at this point. I think the .min() wouldn't really fix things because then we'd run the risk of over-counts.

@pjenvey pjenvey merged commit 3ed6d60 into master Nov 13, 2024
8 checks passed
@pjenvey pjenvey deleted the fix/threadpool-metrics-SYNC-4475 branch November 13, 2024 03:32
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.

2 participants