Repository navigation
fix(preheat): reset the retry budget after a run that fetched data - #134
Merged
dongzhenyangofficial-ctrl merged 1 commit intoOct 19, 2026
Conversation
The 8-attempt budget counted every failure over a job's lifetime. A multi-day preheat meets many unrelated upstream hiccups hours apart; each was recovered by a retry, yet together they exhausted the budget, so the next transient error would fail the job despite steady progress. Track bytes received from upstream; a failed run that fetched at least PreheatRetryResetBytes (1 GiB) restarts the count, so the budget bounds consecutive failures without progress. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
dongzhenyangofficial-ctrl
approved these changes
Oct 19, 2026
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.
Problem
The preheat retry budget (8 attempts, #130) counted every failure over a job's whole lifetime. A multi-day preheat hits unrelated transient upstream errors hours apart. Each one is recovered by a retry, but together they use up the budget, so the next transient error fails the job even though it has been making steady progress.
Fix
Track bytes received from upstream (
fetchedBytes, never reset). If a failed run fetched at leastPreheatRetryResetBytes(1 GiB), the count starts over. The budget now bounds consecutive failures without progress. Non-retryable errors and job cancellation behave as before.Tests
TestPreheatRetryBudgetResetsAfterProgress: five failing runs that each fetched data keep being retried, and two retries without progress follow before giving up. The old logic gives up after 3 attempts.TestPreheatRetriesTransientFailuresandTestPreheatRetryGivesUpstill pass;go test ./...passes (except a known macOS-only case inpkg/hfprojection).🤖 Generated with Claude Code