Skip to content

node: partial holders pull through from each other in a loop (no requester exclusion, no hop guard) #2224

Closed

Description

@thiras

Summary

Two partial holders of the same blob can pull through from each other. A (0, 0) whole-blob header handshake from node A makes partial holder B open its own (0, 0) handshake back to A, and A does the same to B. Each hop holds a serve open until a deadline or the requester's close. The recursion stops only when attempt budgets or deadlines run out, or when per-signer admission refuses (signer_floor_at_cap).

Nothing in the miss path prevents it:

  • The requester is not excluded from upstream candidates.
    • serve_via_window_pull_through gets client_node_id (crates/node/src/handlers/client/window.rs:131), but uses it only for the serve leg.
    • open_pull_leg_bounded (window.rs:935) and NodeOrigin::open_pull_leg(hash, namespace_id, prime) (crates/node/src/node_origin/pull_leg.rs:497) take no peer argument.
    • Candidate filters are negative cache, wedged provider, active staker and buy ceiling. None of them checks the requester.
  • The node's own id is excluded from DHT results only (dht/lookup.rs, via requester_id), not from the origin-directory fallback.
  • The wire has no loop guard. StreamRequest (crates/protocol/src/client.rs:189) carries no hop count, "via" field, or node-to-node marker.
  • The fill is claimed only after the handshake (window.rs:332). A partial holder that is itself mid-handshake therefore looks like it has no fill, and it recurses.

Evidence (testnet, 2026-09-28 ~14:13–14:25 UTC, fleet redeployed 13:32/13:50, CLI aacaf469)

Entry 7cbb4846… (13.5 GiB consolidated.safetensors). bcl holds it whole; fra1 and hel1 hold parts.

  • fra1, serving hel1's (0, 0) request:
    • traces 8a3991bb99858d7299709acf3faaef64 and 5a4eea81bd01f005d5d4f1b6e1099f71 (50 s each) and d04c345a674336861d7fcc9b0d66c96f (13 s);
    • in each, fra1 opens open_progressive_pull peer=hel1 byte_offset=0 byte_len=0, then nothing happens until hel1 closes.
  • fra1 trace d0a08834b68a785fbe61ecb88b463c16:
    • fra1's handshake to hel1 returns delivery refused: NotFound;
    • fra1 then opens a primed 1 MiB head leg to bcl, but serve_miss_pull starts only at +25.1 s;
    • bcl fails that leg at 10 s with proof read timed out (trace 3bb4f58d4823c1cf48c88a71d775f4ba).
  • hel1, serving fra1's (0, 0) request:
    • traces 6bcd8e91…, f333f737…, b4c3b741…, 9e74fd9e…, 6ad27d9f…, aef21279… and fb2ae625…;
    • in each, hel1 opens open_progressive_pull peer=fra1 byte_offset=0 byte_len=0;
    • 620b39a9… is refused with signer_floor_at_cap.
  • decdn_streams_failed_total per 10 min at 14:23: fra1 112, hel1 137, nbg1 43. The baseline earlier in the day was 1–20.
  • decdn_serve_stream_rejected_signer_floor_at_cap_total per 10 min: fra1 20, hel1 8.5, against ~0 before.

The client's pull still completes, because it fails over. But the loop burns per-signer admission, holds serves open for tens of seconds, and makes bcl ship unpaid head chunks.

Proposed fix

  1. Exclude the requesting peer from the upstream candidates: thread client_node_id into open_pull_leg and drop it in probe_and_rank and in the cached-candidate path. This is cheap and breaks every 2-cycle.
  2. Do not pull through for a header-only (0, 0) request on a partial holder. Answer it from local metadata (the signed total_bytes is known), or refuse at once. This also removes the waste in node: a whole-blob header handshake makes a partial holder start a wasted upstream pull #2218.
  3. Longer cycles (A→B→C→A) need either (2) or a hop marker on node-to-node requests. The latter is a wire change, so it needs an ADR first.

Acceptance

  • A test: a partial holder that receives a (0, 0) request from peer P never opens an upstream leg to P.
  • On testnet during a mistral bundle pull, no serve_stream has peer=X while its own open_progressive_pull targets peer=X.

Related: #2218, #2219, #2222

Activity

  1. added
    kind:bug
    on Sep 28, 2026
  2. self-assigned this
    on Sep 28, 2026
  3. thiras commented on Sep 28, 2026

    @thiras
    ContributorAuthor

    The loop widened within minutes. In the 5 minutes to about 14:31 UTC, 93 failed serve_streams were all (0, 0) header requests between partial holders:

    Server Requesting peer Count
    nbg1 hel1 24
    fra1 nbg1 28
    hel1 nbg1 15
    nbg1 fra1 12
    nbg1 lon1 5
    fra1 hel1 3
    hel1 fra1 3

    So the cycles span 3–4 nodes (nbg1/fra1/hel1/lon1), not only 2. Requester exclusion alone (fix 1) will not stop it. Fix 2, where a partial holder does not pull through for a header-only request, or a hop marker, is needed.

  4. thiras commented on Sep 28, 2026

    @thiras
    ContributorAuthor

    Peak scale: decdn_streams_failed_total per 10 min at 14:34 UTC was nbg1 377, fra1 316, hel1 201 (bcl 25). It falls back to tens per 10 min between bundle pulls, so the loop is driven by client traffic that makes these nodes proxies.

  5. assigned and unassigned on Sep 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

kind:bug

Type

No type

Fields

Priority

None yet

Projects

  • Status
    Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions