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

[Merged by Bors] - sync2: fix Advance race #6588

Closed
wants to merge 1 commit into from

Conversation

ivan4th
Copy link
Contributor

@ivan4th ivan4th commented Jan 3, 2025

Motivation

OrderedSet.Advance is not threadsafe, but it's invoked on timer w/o any locking.

Description

SetSyncBase already has a mutex which it's using for advancing so let's use it when advancing the OrderedSet on timer, too.

Test Plan

Existing tests must pass.

OrderedSet.Advance is not threadsafe. SetSyncBase already has a mutex which
it's using for advancing so let's use it when advancing the OrderedSet
on timer, too.
@ivan4th
Copy link
Contributor Author

ivan4th commented Jan 3, 2025

bors merge

spacemesh-bors bot pushed a commit that referenced this pull request Jan 3, 2025
## Motivation

OrderedSet.Advance is not threadsafe, but it's invoked on timer w/o any locking.
Copy link

codecov bot commented Jan 3, 2025

Codecov Report

Attention: Patch coverage is 85.71429% with 1 line in your changes missing coverage. Please review.

Project coverage is 79.9%. Comparing base (1fd07d4) to head (19d3347).
Report is 6 commits behind head on develop.

✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
sync2/p2p.go 0.0% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##           develop   #6588   +/-   ##
=======================================
  Coverage     79.8%   79.9%           
=======================================
  Files          356     356           
  Lines        47316   47321    +5     
=======================================
+ Hits         37775   37820   +45     
+ Misses        7394    7357   -37     
+ Partials      2147    2144    -3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@spacemesh-bors
Copy link

spacemesh-bors bot commented Jan 3, 2025

Build failed (retrying...):

spacemesh-bors bot pushed a commit that referenced this pull request Jan 3, 2025
## Motivation

OrderedSet.Advance is not threadsafe, but it's invoked on timer w/o any locking.
@spacemesh-bors
Copy link

spacemesh-bors bot commented Jan 3, 2025

Pull request successfully merged into develop.

Build succeeded:

@spacemesh-bors spacemesh-bors bot changed the title sync2: fix Advance race [Merged by Bors] - sync2: fix Advance race Jan 3, 2025
@spacemesh-bors spacemesh-bors bot closed this Jan 3, 2025
@spacemesh-bors spacemesh-bors bot deleted the fix/sync2-advance-race branch January 3, 2025 17:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants