Repository navigation
Description
Follow-up to #380, from tschuegy's 6.30.0 retest.
What the retest established
The bounded keep-pin grace shipped in 6.29.0 works: after a 332 s pause the ladder charged three refusals against the pinned target, dropped the pin, re-resolved, and had first data 417 ms later, with the player never seeing it (stall=0 drop=0+0, forward buffer never under 4.0 s, no producer restart, where the same shape used to be ~60 s of frozen picture).
It also answered the open question in that thread, and not the way it was posed. The re-resolved target is the same edge host. What died across the idle was not the address but the authorization behind it: the edge refuses a request for that URL which has not just arrived through the portal, and walking the chain again re-blesses it. The identity of the target is not the signal, the round trip through the source is.
What is still paid for
12.5 s of media time between the first 509 and first data on the healed connection. That was free only because 16 MB of read-ahead absorbed it. The same pause taken right after a seek, with the window still small, is visible to the viewer.
Of those 12.5 s, essentially all are the grace: three paced attempts (1.0 s + 2.0 s + 4.0 s of backoff plus the refusal round trips) against an address that was going to refuse every one of them.
Why the grace can be skipped here, and only here
rateLimitRepinStreak = 3 exists for #307's lingering-slot 509: a connection-capped panel answers 509 while the slot of the connection the reader has just replaced is still occupied server-side. That refusal arrives seconds after our own last delivered byte and clears in seconds, and re-resolving through the portal there spends the one request there is no room for.
That explanation requires a recent byte. An origin that has delivered nothing for a minute cannot be producing the lingering-slot shape, because there is no slot of ours lingering: the pump ends its connection at the window high water, so a paused reader holds nothing at the origin (#310). What remains at that gap is #380's expired lease, which the grace only makes slower to discover.
So: when the last byte off the network is older than pinIdleRepinSeconds, the first rate-limit-shaped refusal drops the pin, instead of the third. The re-resolve that follows is not paced against the address that refused, since it goes to the source, so it skips the exponential backoff (a server-sent Retry-After is still honoured).
The alternative, and why not
The retest suggested the stronger form: spend an idle pin through the source preemptively, before the first request, which would cost 0 in the dead-lease case. It was not taken because it pays a portal round trip on every resume after an idle, including the far more common one where the pin is still alive (717 ms at open against 38 to 134 ms through the pin, in the same trace). Collapsing the grace costs nothing when the pin is alive and one refusal round trip when it is dead.
Shape of the change
- A last-network-delivery timestamp that survives a generation change.
lastDeliveryAtcannot answer this:startPersistentConnectionrebases it to the connection start, so by the time a refusal is judged it always reads as fresh. - Wall clock, not uptime: a lease expires in wall time, and a device that slept through the gap has let it expire too.
- One shared pin-rung decision for both ladders (the empty-window one and the faulted-refill one), which currently carry the same policy in two places.
Activity
test(io): the idle-pin test waits for an event, not for a delivery ra…
Merge pull request #393 from superuser404notfound/fix/idle-pin-repin
superuser404notfound commentedon Aug 17, 2026
Released in 6.30.1, together with the three diagnostic lines from round 3 of #377.
Worth naming what shipped beyond the rung itself, since it came out of writing the test rather than out of the report: the detour cache's rate-limit arm fetches through the same pinned target and carried no pin rung at all, so a dead lease discovered there could only be given up on, which fails the read outright, and never re-resolved. That is the arm a backward read after a long pause lands on, which is close to the case flagged as the one where the runway would not have covered it.
A retest is welcome but not needed for this to be considered settled; the shape it fixes is the one the 6.30.0 trace already measured.
fix(io): an idle pin is dropped by its first refusal, not by the grace (
fix(reader): count a completed range as the connection the next refus…