Repository navigation
fix(io): the other two served-from-memory branches charge the ladders too (#380) - #386
Merged
superuser404notfound merged 2 commits intoAug 17, 2026
Merged
Conversation
… too (#380) #380 fixed the window serve: draining read-ahead is not network progress, so it must not reset the reconnect streaks. The read loop serves from memory in three places and the other two were still clearing them. The retained head/tail spans (#281) are the reachable one. They run FIRST, before every network path, their own log line says "no reconnect for it", and unlike the detour they are NOT taken out of service on a metered origin (a refusal caps the origin to one request, which disables the detour but not the spans). So the parse returning to the head is exactly the "one served byte reset the whole ladder and it started over" the report described, and it survived the fix for it. The detour cache's resident-block hit (#69) is the second. `DetourServe.served` now carries whether the bytes crossed the network, so a block the reader fetched counts and a block it already had does not. That also replaces the `>2 ms` heuristic the slow-read line used to count detour fetches with the ground truth. Both pin lines lose their `#if DEBUG`. Which target is pinned and when the reader drops it is half of every field trace about a redirecting origin, and with the bounded keep-pin grace the drop is a decision the ladder makes, not a reaction to an expiry status. A rung that only fires in the field is worth nothing if the field cannot see it. Rare by construction: a pin that does not change logs nothing. Test drives a real loopback origin that refuses the frontier while the consumer returns to the retained head; it fails on the pre-fix branch (streak 1 -> 0). Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01E5UztmCZtNYPQpzdmSdmWG
CI flake, not a regression: `parked` came back false with `secondGranted` still nil, which is the state where the dispatch block never ran at all. The park observation was spending its whole 10 s window on libdispatch handing out a thread, so a green run and a run that measured nothing looked identical, and the one that measured nothing reported a budget defect. The block now announces itself and the test waits for that first. The acquire's own 20 s timeout still bounds the park, so the assertion is unchanged; only the part that was never about the budget is no longer counted against it. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01E5UztmCZtNYPQpzdmSdmWG
superuser404notfound
deleted the
fix/detour-progress-and-pin-visibility
branch
August 17, 2026 03:45
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to #381, found while reviewing it against main.
#381 fixed the window serve: draining read-ahead is not network progress, so it must not reset the reconnect streaks. The read loop serves from memory in three places and the other two were still clearing them.
The retained head/tail spans (#281) are the reachable one. They run FIRST, before every network path, their own log line says "no reconnect for it", and unlike the detour they are not taken out of service on a metered origin (a refusal caps the origin to one request via the #377 budget, which disables the detour but not the spans). So the parse returning to the head is exactly the "one served byte reset the whole ladder and it started over" that #380 described, and it survived the fix written for it.
The detour cache's resident-block hit (#69) is the second.
DetourServe.servednow carries whether the bytes crossed the network, so a block the reader fetched counts and a block it already had does not. That also replaces the>2 msheuristic the slow-read line used to count detour fetches with the ground truth.Both pin lines lose their
#if DEBUG. Which target is pinned, and when the reader drops it, is half of every field trace about a redirecting origin (#307, #377, #380) — and with #381's bounded keep-pin grace the drop is a decision the ladder makes, not a reaction to an expiry status. A rung that only fires in the field is worth nothing if the field cannot see it. Rare by construction: a pin that does not change logs nothing.Test
ServedFromMemoryProgressTestsdrives a real loopback origin that refuses the frontier with 509 while the consumer returns to the retained head. It passes here and fails on the pre-fix branch (rateLimitStreak1 -> 0).Full suite: 1886 tests / 273 suites green.
🤖 Generated with Claude Code
https://claude.ai/code/session_01E5UztmCZtNYPQpzdmSdmWG