Repository navigation
enh: wait between retries of failed S3 upload requests - #121
Merged
paulmueller merged 1 commit intoOct 23, 2026
Merged
Conversation
Failed part uploads and multipart completion requests were retried immediately, so short connection problems (e.g. "connection refused" by the object store, as seen on the Windows CI runners) led to failed uploads. Now, DCOR-Aid waits 5 s before the first retry, and the waiting time doubles with each retry. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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
Windows CI on
main(run #773) failed two uploads intest_upload_job.py(test_collection,test_full_upload) with:macOS and Ubuntu passed all 275 tests in the same run. The object store refused connections from the Windows runner for a short time (10:08–10:15); other uploads in the same job worked. The same kind of failure appeared on Windows in the #117 run.
requests_put_data_and_get_etag()retried failed part uploads 3 times immediately, so a refusal lasting a few seconds became a failed upload. The same applied to the request that completes a multipart upload. Users on flaky connections are affected in the same way.Changes (
dcoraid/api/s3_api.py)wait_before_retry(attempt, attempts, retry_wait). It waitsretry_wait * 2**attemptseconds, i.e. 5 s then 10 s with the defaults, and never after the last attempt.requests_put_data_and_get_etag()gets a new parameterretry_wait(defaultRETRY_WAIT = 5.0). It waits before retrying after an exception and after an ETag mismatch.upload_s3_presigned_multipart()waits as well, after exceptions, ETag mismatches and error responses.retries=3) is unchanged. Successful uploads are not delayed.Tests
tests/test_api_s3_retry.py, with a mockedrequests.putandtime.sleep:S3UploadErrorwith the original errortest_api_s3.pyandtest_upload_job.pypass locally against dcor-dev (20 passed).Whether the object store limits connections from GitHub's Windows runners would be a question for MPCDF. This PR only makes DCOR-Aid tolerate short interruptions.
🤖 Generated with Claude Code