fix/pool: report a stalled download as a stall even when the body ends cleanly #113

Merged
pti merged 1 commit from fix/download-stall-report into main 2026-10-20 09:21:10 +02:00
Owner

CI run 493, the lint job on the #109 merge to main, failed in TestRelease_Fetch_StallDetector with an integrity mismatch where a stall error was expected. Root cause is a race in admitToCache, not the test. The stall timer cancels the request context, but the transport can hand the body reader a clean EOF for the truncated body before it reports the context error, so the copy returned nil, the digest check ran on the partial bytes and the error named a mismatch instead of the stall. The fix checks the stall cause after the copy and reports the stall however the read ended. A new deterministic test drives the race through a RoundTripper whose body answers the cancellation with io.EOF. Mutation check done, removing the new branch reproduces the exact CI error text. CHANGELOG Fixed bullet added. Independent of #110 and #112. Generated with Claude Code.

CI run 493, the lint job on the #109 merge to main, failed in TestRelease_Fetch_StallDetector with an integrity mismatch where a stall error was expected. Root cause is a race in admitToCache, not the test. The stall timer cancels the request context, but the transport can hand the body reader a clean EOF for the truncated body before it reports the context error, so the copy returned nil, the digest check ran on the partial bytes and the error named a mismatch instead of the stall. The fix checks the stall cause after the copy and reports the stall however the read ended. A new deterministic test drives the race through a RoundTripper whose body answers the cancellation with io.EOF. Mutation check done, removing the new branch reproduces the exact CI error text. CHANGELOG Fixed bullet added. Independent of #110 and #112. Generated with Claude Code.
fix(pool): report a stalled download as a stall even when the body ends cleanly
All checks were successful
Lint / lint (pull_request) Successful in 45s
Lint / sonarqube (pull_request) Has been skipped
9b4cc0fb75
The stall timer cancels the request context, but the transport may hand
the body reader a clean EOF for the truncated body before it reports the
context error. admitToCache then ran the digest check on the partial
bytes and returned an integrity mismatch, which is what made
TestRelease_Fetch_StallDetector flake on the CI runner (run 493 on main).

After the copy, check whether the stall cause was set and report the
stall regardless of how the read ended. A deterministic test drives the
race through a RoundTripper whose body answers the cancellation with
io.EOF; without the fix it reproduces the mismatch error byte for byte.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
pti merged commit c532838f39 into main 2026-10-20 09:21:10 +02:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
pti/wraptool!113
No description provided.