Cleanup gossip peer outbound state on disconnect#1534
Open
quake wants to merge 1 commit into
Open
Conversation
chenyukang
reviewed
Jul 7, 2026
| } | ||
| GossipActorMessage::PeerDisconnected(pubkey, _session) => { | ||
| state.peer_states.remove(&pubkey); | ||
| state.policy.remove_outbound_peer(&pubkey); |
Collaborator
There was a problem hiding this comment.
here removes the peer outbound bucket before dropping delayed outbound messages, but drop_delayed_outbound_messages_for_peer refunds each queued message, and refund_outbound_message recreates the same peer bucket via peer_outbound.entry(...).or_insert_with(...). So any disconnected peer with delayed gossip payloads still leaves an outbound bucket behind, which means this PR does not actually clean up the peer state in the case most relevant to queue/backpressure cleanup. Move remove_outbound_peer after the delayed-message refund/drop, or add a refund path that does not recreate per-peer state during disconnect cleanup.
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
Tests