Skip to content

Conversation

@quantpoet
Copy link
Contributor

Replaced separate atomic load/store operations with a single fetch_xor to eliminate
the race condition where multiple threads could read the same value and write
conflicting results. This ensures the read-modify-write operation is truly atomic
and resolves the lockbud-detected atomicity violation.

@quantpoet quantpoet changed the title Fix atomicity violation in AtomicSamplingReservoir::consume using fet… Fix atomicity violation in AtomicSamplingReservoir::consume Sep 19, 2025
@quantpoet
Copy link
Contributor Author

@tobz Hi, Could you please review this PR at your convenience? Thank you very much.

@tobz tobz added C-util Component: utility classes and helpers. E-simple Effort: simple. T-bug Type: bug. labels Sep 24, 2025
@tobz
Copy link
Member

tobz commented Sep 24, 2025

👋🏻

Sorry about the delay.

Signed-off-by: quantpoet <quantway@outlook.com>
@tobz tobz merged commit 5b45a59 into metrics-rs:main Oct 10, 2025
14 checks passed
@tobz tobz added the S-awaiting-release Status: awaiting a release to be considered fixed/implemented. label Oct 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

C-util Component: utility classes and helpers. E-simple Effort: simple. S-awaiting-release Status: awaiting a release to be considered fixed/implemented. T-bug Type: bug.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants