Skip to content

bug: missing orphans et clear + fix eviction multiset tracking#135

Merged
lvboudre merged 3 commits intomainfrom
small-fixes
Mar 6, 2026
Merged

bug: missing orphans et clear + fix eviction multiset tracking#135
lvboudre merged 3 commits intomainfrom
small-fixes

Conversation

@lvboudre
Copy link
Collaborator

@lvboudre lvboudre commented Feb 26, 2026

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.

@lvboudre lvboudre requested a review from leafaar February 26, 2026 19:51
Copy link
Contributor

@leafaar leafaar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good fix, lgtm!

@lvboudre lvboudre added this pull request to the merge queue Mar 6, 2026
Merged via the queue into main with commit b3873c4 Mar 6, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants