You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
dht: RepublishScheduler swallows mutex poison at every lock site #1808
Mutex poison is sticky, so one panic inside any guarded region converts the scheduler into a black hole for the process lifetime: nothing is ever scheduled, nothing is ever drained, and the node silently stops advertising every hash it holds. It keeps serving, probing and settling payments normally, so all liveness signals stay green while it falls out of content discovery and its earnings decay.
Why this is worth fixing rather than leaving
The crate already has the right convention one module over. crates/node/src/dht/chain_projection.rs provides with_read/with_write, which warn! and recover via PoisonError::into_inner, with a test at accessors_recover_a_poisoned_lock. capacity_bond_registry.rs routes every lock through it, and the workspace Cargo.toml names dht::chain_projection as the canonical poison-recovery layer. publish.rs is the outlier.
Recovery is safe here. The invariant is "scheduled mirrors the heap"; drain_due already tolerates a heap entry absent from scheduled, and schedule_with_offset already tolerates the converse. A torn state degrades to a spurious or a skipped republish, not corruption.
Suggested fix
Add Mutex analogues of with_read/with_write (or extend chain_projection to cover Mutex) and route all seven sites through them, recovering with into_inner plus a warn!.
#1806 added an error! to schedule_if_absent only, because that site's false return newly flows into an operator-visible count — a poisoned lock there is indistinguishable from a healthy no-op sweep. The other six are still silent.
Activity