fix: drain outbound connections during shutdown - #3596
Closed
GrapeBaBa wants to merge 4 commits into
Closed
Conversation
This was referenced Aug 11, 2026
Contributor
Author
|
Superseded by #3597. A controlled 50-cycle mainnet shutdown soak showed that only the minimal socket reset guard was required: unmodified Lodestar, 50 clean exits, 0 hangs. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Prevent shutdown from finishing while outbound dial jobs or TCP sockets still own referenced native handles.
This was observed while investigating a Lodestar shutdown hang: https://gist.github.com/nflaig/5f41cfc50f38baf5046a034162943dc3
Tested version
This draft intentionally points to commit c20c703, the exact js-libp2p source used to build Lodestar image sha256:2c2bcfbe1a9adf72cb9f73dfc605fb3a149e283d8aeae6b0325bbefd5e1b13f9.
The affected compiled libp2p and TCP files in the running image were compared byte-for-byte with the artifacts built from this commit. All hashes match.
The image has completed 44 consecutive effective mainnet shutdown cycles without a hang so far. The 50-cycle soak is still running.
This branch is intentionally not merged with newer main commits yet, so the PR head remains identical to the tested version.
Verification
Change checklist