-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
op-node: log shutdown before releasing client waitgroup #6101
Conversation
|
✅ Deploy Preview for opstack-docs canceled.
|
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.
LGTM.
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## develop #6101 +/- ##
===========================================
- Coverage 45.49% 44.58% -0.91%
===========================================
Files 434 304 -130
Lines 28017 23291 -4726
Branches 688 0 -688
===========================================
- Hits 12745 10384 -2361
+ Misses 14240 11945 -2295
+ Partials 1032 962 -70
Flags with carried forward coverage won't be shown. Click here to find out more.
|
This PR has been added to the merge queue, and will be merged soon. |
This PR is next in line to be merged, and will be merged as soon as checks pass. |
1 similar comment
This PR is next in line to be merged, and will be merged as soon as checks pass. |
Description
Fix test issues where the test-logger was being used after the test shut down.
The
TestMultiPeerSync
defers the.Close()
calls on the sync clients, but those then completed the wait-group in the sync client, before logging about the shutdown. This caused a race where the logger would panic because of the unexpected log.The fix is to move the log before the
wg.Done()
.Reviewing the code further there also seems to be a case where we could have a warn-log while the client was already shutting down. We now return early in
AddPeer
if we're closing already, to ensure post-shutdown AddPeer calls cannot accidentally create logs that make the test flake.