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

core/consensus: fixed instance_io race #3416

Merged
merged 3 commits into from
Dec 12, 2024

Conversation

pinebit
Copy link
Contributor

@pinebit pinebit commented Dec 12, 2024

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

Copy link

codecov bot commented Dec 12, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 57.36%. Comparing base (b7b72cd) to head (9ed167e).
Report is 1 commits behind head on main.

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.
📢 Have feedback on the report? Share it here.

@pinebit pinebit added the merge when ready Indicates bulldozer bot may merge when all checks pass label Dec 12, 2024
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.
Copy link
Collaborator

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.

Copy link
Collaborator

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?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Indeed, changed as suggested.

@obol-bulldozer obol-bulldozer bot merged commit 81005ac into main Dec 12, 2024
13 checks passed
@obol-bulldozer obol-bulldozer bot deleted the pinebit/fixing-instance-io-race branch December 12, 2024 10:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merge when ready Indicates bulldozer bot may merge when all checks pass
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants