bug: missing orphans et clear + fix eviction multiset tracking#135
Merged
bug: missing orphans et clear + fix eviction multiset tracking#135
Conversation
569ffcf to
bf67811
Compare
e55482c to
1ab232c
Compare
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.
Removed as many connection::remote_address() because it hides lock.
High severity: live connection can be dropped by stale orphan entry
In core.rs:2612, update_identity() clears connection_map but does not clear orphan_connection_set.
Later, try_evict_orphan_connections at core.rs:2868 removes from connection_map before checking version at core.rs:2872.
If an old orphan record (old identity/version) matches the same address as a new active connection, this path removes the new connection from connection_map and then continues on version mismatch, effectively dropping state for a live connection.
ConnectionEvictionSet address index can become inconsistent
ConnectionEvictionSet tracks both a full eviction set and socket_addr_set.
On remove, it always deletes the socket addr: core.rs:467-471.
If two eviction entries exist for the same address with different versions, removing one clears socket_addr_set even though another still exists.
Then contains_socket_addr() can return false incorrectly, affecting blocking logic in spawn_connecting at core.rs:1655-1660.
If you want, I can patch both now with minimal changes:
clear orphan_connection_set during identity update, and
only remove socket addr from socket_addr_set when no remaining eviction for that addr exists.
Jet
Added more metrics to see when transaction parsing/decoding went wrong in the grpc + rpc path.