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

op-node: log shutdown before releasing client waitgroup #6101

Merged
merged 2 commits into from
Jun 21, 2023

Conversation

protolambda
Copy link
Contributor

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.

@protolambda protolambda requested a review from tynes June 21, 2023 21:21
@protolambda protolambda requested a review from a team as a code owner June 21, 2023 21:21
@changeset-bot
Copy link

changeset-bot bot commented Jun 21, 2023

⚠️ No Changeset found

Latest commit: e359b31

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@netlify
Copy link

netlify bot commented Jun 21, 2023

Deploy Preview for opstack-docs canceled.

Name Link
🔨 Latest commit e359b31
🔍 Latest deploy log https://app.netlify.com/sites/opstack-docs/deploys/64936c6435ea6a0008b87d76

Copy link
Contributor

@ajsutton ajsutton left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

@codecov
Copy link

codecov bot commented Jun 21, 2023

Codecov Report

Merging #6101 (e359b31) into develop (e2d3e59) will decrease coverage by 0.91%.
The diff coverage is 25.00%.

Additional details and impacted files

Impacted file tree graph

@@             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     
Flag Coverage Δ
bedrock-go-tests 44.58% <25.00%> (-0.13%) ⬇️
cannon-go-tests ?
common-ts-tests ?
contracts-bedrock-tests ?
core-utils-tests ?
fault-detector-tests ?
sdk-tests ?

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
op-node/p2p/sync.go 62.63% <25.00%> (-6.16%) ⬇️

... and 130 files with indirect coverage changes

@mergify
Copy link
Contributor

mergify bot commented Jun 21, 2023

This PR has been added to the merge queue, and will be merged soon.

@mergify
Copy link
Contributor

mergify bot commented Jun 21, 2023

This PR is next in line to be merged, and will be merged as soon as checks pass.

1 similar comment
@mergify
Copy link
Contributor

mergify bot commented Jun 21, 2023

This PR is next in line to be merged, and will be merged as soon as checks pass.

@OptimismBot OptimismBot merged commit 1c70757 into develop Jun 21, 2023
@OptimismBot OptimismBot deleted the fix-sync-test-log-shutdown branch June 21, 2023 21:46
@mergify mergify bot removed the on-merge-train label Jun 21, 2023
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.

3 participants