Skip to content

dht: routing-table poison recovery is split between the republisher and the query path #1816

Closed

Description

@thiras

Surfaced by review of #1813.

#1813 routed the two routing-table Mutex sites in crates/node/src/dht/publish.rs through chain_projection::with_lock, so the republisher recovers from a poisoned table instead of returning early. The same Arc<Mutex<RoutingTable>> is locked elsewhere without recovery:

Site On poison
crates/node/src/handlers/dht.rs — closest_to returns CloserNodes::default() on every inbound FindNode/FindValue
crates/node/src/handlers/dht.rs — note_peer_seen bare if let Ok(..) with no else; every learned peer silently dropped
crates/node/src/dht/bucket_refresh.rs same shape, silent
crates/node/src/dht/bootstrap.rs same shape, silent

Before #1813 a poisoned table degraded the whole routing path uniformly. Now the republisher keeps working while the query path answers every lookup with an empty table — a node that looks healthier and is harder to diagnose.

closest_to's comment calls the empty answer "honest at this moment regardless of the lock state". It is not: it is an assertion about the table's contents that the code cannot make from a poisoned guard.

Suggested fix

Route all four through with_lock. Since #1813 the helper clears the poison as it recovers, so the warn is one line per panic rather than one per inbound request — which is what made recovery on these hot paths unattractive before.

note_peer_seen's bare if let Ok should not stay silent either way.

Activity

  1. added
    rust
    on Aug 24, 2026
  2. moved this from Backlog to In progress in deCDNon Aug 25, 2026
  3. moved this from In progress to Done in deCDNon Aug 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

rust

Type

No type

Fields

Priority

None yet

Projects

  • Status
    Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions