Skip to content

dht: a dead bonded peer makes a third of lookups wait the 8 s round timeout #2532

Closed

Description

@thiras

Problem

A third of the fleet's DHT lookups wait the full 8 s round timeout, every time, because one bonded peer never answers find_value.

On 2026-10-18 09:45–14:20 UTC (the #2366 batch), increase(decdn_dht_lookup_round_timeouts_total) against increase(decdn_dht_findvalue_queries_total):

node round timeouts lookups
fra1 115 296
hel1 54 160
ash1 20 37
nbg1 12 42
lon1 11 55
hil1 8 13
sin1 5 10

Every dht_lookup span Tempo sampled on hel1 for the SDXL blob 89bdeffb… in 11:20–11:40 UTC ran 8.00 s: rounds=1, providers=1 (one providers=0), and each one logged dht lookup: round timeout fired; aborting in-flight RPCs aborted_peers=1 timeout_ms=8000.

decdn_staker_set_active_count reads 9 on every node for the whole window, and 8 nodes are live (ash1, bcl, fra1, hel1, hil1, lon1, nbg1, sin1). The ninth bonded NodeId seeds every routing table through the staker set, and DHT_CLIENT_TIMEOUT (8 s, crates/node/src/dht/client.rs) equals DEFAULT_ROUND_TIMEOUT (8 s, crates/node/src/dht/lookup.rs), so a round whose α=3 batch holds that peer always runs to the round timeout.

Cost

Each such lookup adds 8 s to a serve-miss pull leg before the probe round starts. WINDOW_PULL_FALLBACK_DEADLINE and node_pull_timeout_sec absorb it, so no pull times out, but the client waits the 8 s on every affected cold miss, and PULL_THROUGH_OUTER_SLACK budgets up to four such rounds.

To check

  • Which bonded NodeId it is: read the CapacityBond active set and compare it with the live fleet.
  • Whether the RPC should have a dial timeout below the round timeout, so one dead peer costs a round less than the whole round.
  • Whether the routing table should demote a peer that times out on consecutive rounds, so the lookup stops picking it.

Found while working on #2366.

Activity

  1. added
    area:node
    on Oct 18, 2026
  2. self-assigned this
    on Oct 18, 2026
  3. thiras commented on Oct 18, 2026

    @thiras
    ContributorAuthor

    Which bonded NodeId it is. CapacityBond.getRegisteredNodes(0, 50) on Arbitrum Sepolia (0x65a9e38F41B9bE2fcB97950a0E3c33e506E6E353) returns 9 nodes, every one active. Eight match the fleet (bcl 23.161.96.215, fra1, lon1, nbg1, hel1, ash1, hil1, sin1). The ninth is a third-party bond, not in our inventory:

    field value
    nodeId 0x848f91a6fdd7c694b49dcf67d84066685f79ec609db7469312febf0147f72df4 (iroh qshzdjx527djjne5z5t5qqdgnbpxt3datw3uneys727qcr7xfx2a)
    operator 0x31732c9C3cCEc425EAdD714269d450f0452bF124
    multiaddr /ip4/177.2.140.159/udp/4433/quic-v1, regionHint BR
    registered 2026-10-13 05:55 UTC (lastMultiaddrUpdate 1791870937)

    It resolves an address from the registry mirror, so every dial sends a QUIC handshake that is never answered, and the single DHT_CLIENT_TIMEOUT (connect + handshake + exchange) runs to 8 s. We cannot deregister a third-party bond, and a bonded-but-dead peer is a permanent condition of an open network, so the fix is node-local.

    On the other two questions, from reading dht/client.rs, dht/lookup.rs and dht/routing.rs:

    • There is no dial timeout today. One tokio::time::timeout(DHT_CLIENT_TIMEOUT, …) wraps connect_with_opts, the handshake await and the exchange. The round timer starts after the RPC tasks spawn, so with both at 8 s the round timer always fires first (aborted_peers=1). A connect+handshake timeout well below the round timeout (2 s) turns a dead peer into a fast Transport error, and the round drains cleanly.
    • Nothing records the failed peer. RoutingTable has no failure state, remove has no production caller, and the lookup never writes back to the table, so the next lookup seeds the same peer again. A per-peer dial-failure cooldown on the routing table (the peer stays in the table and in closer_nodes answers; this node's lookups skip it for the window; an inbound request from it clears the mark) removes the repeat cost.

    PR for both to follow. #2534 is fixed separately in #2535.

  4. moved this from Backlog to In progress in deCDNon Oct 18, 2026
  5. moved this from In progress to Done in deCDNon Oct 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area:node

Type

No type

Fields

Priority

None yet

Projects

  • Status
    Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions