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

fixes data race in state.Slot #5067

Merged
merged 1 commit into from Mar 11, 2020
Merged

fixes data race in state.Slot #5067

merged 1 commit into from Mar 11, 2020

Conversation

farazdagi
Copy link
Contributor

When writing tests for initial sync, I've noticed that BeaconState.Slot()/SetSlot() has a data race condition (on getter we don't obtain mutex). This PR fixes that race.

I haven't enabled "race=on" in the BUILD.bazel because there are a lot of data races in other tests of the state package (and I can't jump to that rabbit hole just yet).

@farazdagi farazdagi requested a review from nisdas March 11, 2020 09:02
@codecov
Copy link

codecov bot commented Mar 11, 2020

Codecov Report

Merging #5067 into master will increase coverage by 21.8%.
The diff coverage is 100%.

@@            Coverage Diff             @@
##           master    #5067      +/-   ##
==========================================
+ Coverage   35.81%   57.61%   +21.8%     
==========================================
  Files         215      270      +55     
  Lines       16836    20231    +3395     
==========================================
+ Hits         6030    11657    +5627     
+ Misses       9800     6975    -2825     
- Partials     1006     1599     +593

@prylabs-bulldozer prylabs-bulldozer bot merged commit 46eb228 into master Mar 11, 2020
@delete-merged-branch delete-merged-branch bot deleted the state-getters-race branch March 11, 2020 09:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants