Skip to content

p2p: Close all connections and wsPeers on P2P network shutdown#5712

Merged
cce merged 13 commits intoalgorand:masterfrom
iansuvak:p2p/closing-peers
Aug 31, 2023
Merged

p2p: Close all connections and wsPeers on P2P network shutdown#5712
cce merged 13 commits intoalgorand:masterfrom
iansuvak:p2p/closing-peers

Conversation

@iansuvak
Copy link
Copy Markdown
Contributor

Summary

This PR defines an innerStop() method similar to the one in wsNetwork that loops through the wsPeers and shuts them down as part of the network Stop method. Additionally it prevents unnecessary logging on node shutdown by checking if the error is caused by context cancellation shutting down the whole node.

Test Plan

Existing tests should pass and data races on wsPeer logging should no-longer occur due to logging after test is over.

@codecov
Copy link
Copy Markdown

codecov Bot commented Aug 30, 2023

Codecov Report

Merging #5712 (55a0f95) into master (ca420de) will decrease coverage by 0.01%.
Report is 4 commits behind head on master.
The diff coverage is 47.22%.

@@            Coverage Diff             @@
##           master    #5712      +/-   ##
==========================================
- Coverage   55.21%   55.21%   -0.01%     
==========================================
  Files         473      473              
  Lines       66156    66180      +24     
==========================================
+ Hits        36528    36539      +11     
- Misses      27164    27171       +7     
- Partials     2464     2470       +6     
Files Changed Coverage Δ
network/p2pNetwork.go 60.66% <44.82%> (-1.26%) ⬇️
network/wsPeer.go 73.60% <50.00%> (+0.37%) ⬆️
network/p2pPeer.go 75.00% <60.00%> (-5.00%) ⬇️

... and 14 files with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

Comment thread network/p2pPeer.go
@iansuvak iansuvak requested review from algorandskiy and cce August 30, 2023 20:24
@iansuvak iansuvak added the p2p Work related to the p2p project label Aug 30, 2023
Comment thread network/p2pPeer.go
cce
cce previously approved these changes Aug 31, 2023
Comment thread network/p2pNetwork.go Outdated
Comment thread network/p2pNetwork.go Outdated
@algorandskiy algorandskiy requested a review from cce August 31, 2023 18:20
@cce cce merged commit f12005b into algorand:master Aug 31, 2023
@iansuvak iansuvak deleted the p2p/closing-peers branch August 31, 2023 19:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

p2p Work related to the p2p project Skip-Release-Notes Team Carbon-11

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants