-
Notifications
You must be signed in to change notification settings - Fork 95
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
core/consensus: fixed instance_io race #3416
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #3416 +/- ##
=======================================
Coverage 57.36% 57.36%
=======================================
Files 217 217
Lines 31977 31965 -12
=======================================
- Hits 18343 18338 -5
+ Misses 11743 11739 -4
+ Partials 1891 1888 -3 ☔ View full report in Codecov by Sentry. |
core/consensus/utils/instance_io.go
Outdated
Participated chan struct{} // Closed when Participate was called for this instance. | ||
Proposed chan struct{} // Closed when Propose was called for this instance. | ||
Running chan struct{} // Closed when runInstance was already called. | ||
Participated int32 // Closed when Participate was called for this instance. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should change those comments, there are no channels involved in this anymore.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not an atomic.Bool
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indeed, changed as suggested.
Quality Gate passedIssues Measures |
Observed a bug in our consensus object
instance_io
where we have the race condition:panic: close of closed channel
Fixed the race condition using atomic operations instead of channels.
category: bug
ticket: none