create file retries: do not sleep before giving up on the last try#9874
Merged
ThomasWaldmann merged 1 commit intoJul 7, 2026
Merged
Conversation
When all retries for a file were used up, the error is re-raised anyway, so sleeping before that is pointless - on the last try, the sleep was up to ~31.6s (retry 9) per permanently failing file, e.g. on a disk that gives I/O errors for many files. Check last_try first and re-raise immediately; only sleep (and log the retry warning) when another attempt will actually follow. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #9874 +/- ##
==========================================
+ Coverage 85.12% 85.14% +0.01%
==========================================
Files 93 93
Lines 15459 15479 +20
Branches 2337 2343 +6
==========================================
+ Hits 13159 13179 +20
Misses 1599 1599
Partials 701 701 ☔ View full report in Codecov by Harness. |
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.
In
_process_any's retry handler (from #7351), the sleep happens before checking whether this was the last try. When all retries are used up, the error is re-raised anyway, so that final sleep is pointless — and it is the longest one of the backoff sequence: retry 9 sleeps10^4.5ms ≈ 31.6 s. On a source with many permanently failing files (e.g. a disk returning I/O errors), that adds ~31.6 s per failing file on top of the earlier backoff sleeps.Check
last_tryfirst and re-raise immediately; only sleep (and log the retry warning) when another attempt will actually follow. Theif retry < MAX_RETRIES - 1/elsesplit around the warning becomes unnecessary, since the handler now only reaches that point when a retry follows.No behavior change for retried files: same backoff sleeps, same warning messages.
🤖 Generated with Claude Code