-
Notifications
You must be signed in to change notification settings - Fork 219
Fix data race in downloader #1961
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
Conversation
Coverage from tests in coverage: 45.8% of statements across all listed packagescoverage: 52.6% of statements in consensus/istanbul coverage: 40.0% of statements in consensus/istanbul/announce coverage: 54.7% of statements in consensus/istanbul/backend coverage: 0.0% of statements in consensus/istanbul/backend/backendtest coverage: 24.3% of statements in consensus/istanbul/backend/internal/replica coverage: 52.0% of statements in consensus/istanbul/core coverage: 45.0% of statements in consensus/istanbul/db coverage: 0.0% of statements in consensus/istanbul/proxy coverage: 64.4% of statements in consensus/istanbul/uptime coverage: 51.8% of statements in consensus/istanbul/validator coverage: 79.2% of statements in consensus/istanbul/validator/randomCommentID: a3fcedc7ea |
Codecov ReportBase: 54.82% // Head: 54.79% // Decreases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## master #1961 +/- ##
==========================================
- Coverage 54.82% 54.79% -0.03%
==========================================
Files 688 695 +7
Lines 92542 93251 +709
==========================================
+ Hits 50737 51099 +362
- Misses 37993 38309 +316
- Partials 3812 3843 +31
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
This comment was marked as outdated.
This comment was marked as outdated.
d149920
to
3c59b0d
Compare
567e55b
to
766f0f8
Compare
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.
Great!
Description
The race detector found a problem when running with
go test -race -count=1 ./eth/downloader
.It turns out that
celo-blockchain/eth/downloader/queue.go
Line 505 in 67b6239
resultstore
.This value is later changed here (added in the latest upstream pull):
celo-blockchain/eth/downloader/queue.go
Lines 531 to 534 in 620b5fc
AllDone
:celo-blockchain/eth/downloader/resultstore.go
Line 154 in 67b6239
I guess this patch is the easy solution to avoid the race, but there might be a better way to avoid this in the first place. It seems ugly that
pending
is accessed in the first place there. I'm open to suggestions.Other changes
Some typos.
Tested
This triggered the race detector when run with
go test -race -count=1 ./eth/downloader
. With these changes it didn't trigger locally with a count of 20.Related issues
/
Backwards compatibility
/