net: tear down peer session when writer dies (mempool_reorg flake) - #307
Merged
Conversation
After tip sync, disconnect_nodes still flaked waiting for the far side's getpeerinfo: a write failure or BIP324 close mapped oddly could leave the session in getpeerinfo past 5s. Select on writer-task completion, treat any socket Io as a clean peer-gone exit, and map ConnectionAborted through as Io.
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.
Summary
Core-functional attempt 1 of run 33310407181 failed
mempool_reorg.pyon the same far-sidedisconnect_nodes5sgetpeerinfowait, even with #304’sShutdown::Bothon the tree.Fix:
select!on writer-task completion so a half-close / write error tears the session down (andunregisterruns) without waiting on a stuck read/decode arm.NetError::Ioon read as clean peer-gone.ConnectionAborted(+ RetryV1) toNetError::Iolike the other hard-close kinds.Test plan
disconnect_after_tip_sync_clears_far_side_within_5sdisconnect_clears_far_side_getpeerinfo_within_5sdisconnect_id_shuts_down_tcp_so_far_side_sees_eofcore-functional(label)