fix: replace unsafe currentSubtree.Load().Length() with channel-synce…#641
Conversation
…d GetCurrentLength() in subtree processor tests
|
🤖 Claude Code Review Status: Complete Current Review: This PR improves test reliability by replacing racy Key improvements:
Minor observations:
No issues found. The changes correctly address the race conditions in the original code. |
|
Benchmark Comparison ReportBaseline: Current: Summary
All benchmark results (sec/op)
Threshold: >10% with p < 0.05 | Generated: 2026-05-23 07:31 UTC |
oskarszoon
left a comment
There was a problem hiding this comment.
Approve. This is the clean standalone race fix — currentSubtree.Load().Length() is genuinely unsafe (atomic-pointer load + non-atomic method call on the loaded value), GetCurrentLength() provides the channel-sync happens-before edge.
One coordination note: this overlaps exactly with the SubtreeProcessor_test.go changes in #639, so exactly one should land. Asked #639 author to drop the duplicate. If you'd rather close this one and let #639 carry the fix instead, fine either way — but this branch is the cleaner option (no settings-test cargo).
|



…d GetCurrentLength() in subtree processor tests