-
Notifications
You must be signed in to change notification settings - Fork 90
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
app/eth2wrap: fix cancelled context race #1378
Conversation
zero O | ||
nokResp forkjoin.Result[Client, O] | ||
hasNokResp bool | ||
zero O | ||
) | ||
for res := range join() { |
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.
when the calling context is already/immediately closed, then forkjoin doesn't return any results.
} | ||
} | ||
|
||
if ctx.Err() != nil { | ||
return zero, ctx.Err() | ||
} else if !hasNokResp { |
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.
this is just a sanity check and should never happen
Codecov ReportBase: 54.19% // Head: 54.26% // Increases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## main #1378 +/- ##
==========================================
+ Coverage 54.19% 54.26% +0.07%
==========================================
Files 144 144
Lines 17750 17757 +7
==========================================
+ Hits 9619 9636 +17
+ Misses 6809 6796 -13
- Partials 1322 1325 +3
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. |
Fixes a race in
eth2wrap
forkjoin code when context is cancelled before any results are returned. This resulted in<zero>,nil
being returned which resulted in unexpected behaviour, including "divide by zero".category: bug
ticket: #1326