Skip to content

design: byte-progress stall detection — whole-frame inactivity deadlines are too coarse #1797

Closed

Description

@alpergundogdu

Follow-up from the frame-size discussion in #1796. The requester-side stall model in ADR 005 §Retry behavior is a fixed inactivity deadline counted in completed frames: 10 s from StreamRequest to the first ChunkData, and mid-stream "if chunks stop arriving, wait 10 seconds, then reconnect". The §Non-empty chunk rationale ties the soundness of that bound to "a frame arrived" and "bytes made progress" being the same statement.

That equivalence is the weak point, and #1796 widens it: a frame only counts as progress when it is fully received, so the detector's resolution is one frame. Consequences:

  • False positives on slow links scale with frame size. With sender's-choice frames (bounded by the 16 MiB framing cap), an honest sender emitting large frames to a slow client can exceed the 10 s whole-frame gap while bytes are flowing continuously. The receiver aborts a healthy transfer and burns one of its 3 per-blob attempts.
  • False negatives at any frame size. An adversarial or degraded sender can drip one small frame every 9.9 s indefinitely — "progress" by the frame metric, ~100 B/s by any real metric. On 300–500 GB transfers this is effectively a permanent wedge that never trips the deadline, and the per-attempt timeout only guards time-to-first-chunk.
  • The deadline is context-free. 10 s means different things on a 10 Gbps peer link and a mobile client; a single constant cannot express "this transfer is slower than it should be".

Direction (to be designed — not committing to a mechanism yet)

Replace whole-frame inactivity with byte-level progress as the primitive: count bytes read off the QUIC stream (partial frames included), so the signal is frame-size-independent. On top of that primitive, candidates to evaluate:

  • a minimum-throughput floor over a sliding window (EWMA or windowed byte counter) instead of a binary idle deadline, with the floor derived from the probe-time RTT/bandwidth estimate the requester already has;
  • separate budgets for time-to-first-verified-group vs. steady-state throughput, since the first-byte path includes upstream fill on a miss (ADR 037 window pacing) and legitimately has different latency structure;
  • how the abort classifies for reputation (ADR 008): a throughput-floor abort is requester-local policy and must stay non-attributable, same as today's unsigned timeouts — the §Non-empty chunk concern that a spoofable stalled-peer signal must not affect scoring carries over and needs restating against the new primitive;
  • interaction with the credit window: delivery legitimately pauses at the window boundary waiting for the payer's own proof, so the detector must not count a self-inflicted payment pause as a sender stall (the payer knows its own unpaid balance and can gate the detector on it).

Wire impact: none expected — this is requester-local policy. ADR 005 §Retry behavior and §Non-empty chunk get rewritten to state the progress primitive and the non-attribution rule; the non-empty frame rule itself stays (empty frames are still a protocol error).

Not scheduled yet — parked for design after #1796 lands. Filed so the frame-size change doesn't silently inherit the coarse detector as a permanent assumption.

Related: #1796, #1791, ADR 005, ADR 008, ADR 037.

Metadata

Metadata

Assignees

Labels

design:adrkind:featureprio:medium

Type

No type

Fields

Priority

None yet

Projects

  • Status
    Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions