-
-
Notifications
You must be signed in to change notification settings - Fork 300
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
fix: close peer manager before sending goodbye to all peers #5746
Conversation
Performance Report✔️ no performance regression detected Full benchmark results
|
66d6846
to
a8bd735
Compare
This PR does not resolve the issue, see #5642 (comment). I think it might not be a correct change as closing the peer manager removes lodestar/packages/beacon-node/src/network/peers/peerManager.ts Lines 206 to 209 in 0640e06
which should take care that we are not pinging peers lodestar/packages/beacon-node/src/network/peers/peerManager.ts Lines 633 to 634 in 0640e06
But there is also another listener for handling new connections
It seems more logical to me that we first stop accepting and handling new connections and then disconnect existing peers. Maybe @wemeetagain or anyone else more familiar with that part of the code has some thoughts |
Looks like this change causes an issue in Sim tests, the job hangs for ~6 hours until it is aborted. |
Closing as this PR does not fix #5642. |
hmm but this looked like a reasonable change right? We don't want to dial more peers when goodbye-ing existing. Can you double check why that happens? |
I think the change makes sense but will look into the code again and make sure I've not missed anything
I went through the sim test logs but there is nothing that peaks out or looks different from other runs. I have rebased the branch against unstable and the sim tests pass now. |
Took another look at this and the difference of changing the order is really insignificant and I am still not 100% sure if removing
I see three options
close-before-goodbye-keep-onLibp2pPeerDisconnect-listener.txt I don't feel like this must be changed as it has worked for so long like this and doesn't resolve issue #5642. Keeping as is until I understand the whole networking code a bit better, changes are in branch unstable...nflaig/close-peermanager-before-goodbye, will not open a PR for now unless someone thinks it's really worth to change current behavior. |
Motivation
Closes #5642
Description
Closes peer manager before sending goodbye to all peers, see #5642 (comment) for rationale.
I looked at the code and this should not cause any issues as closing peer manager only removes intervals, event listeners and closes discv5.