Skip to content

Fix artifact upload retries - #1003

Merged
kzscisoft merged 3 commits into
devfrom
james/fix_artifact_upload_retries
Sep 2, 2026
Merged

Fix artifact upload retries#1003
kzscisoft merged 3 commits into
devfrom
james/fix_artifact_upload_retries

Conversation

@james-panayis

Copy link
Copy Markdown
Collaborator

Fix artifact upload retries

Issue: #1002

Python Version(s) Tested: Python 3.11.13

Operating System(s): Linux Ubuntu 26.04

📝 Summary

Artifact upload retries reused already-consumed file streams, causing subsequent attempts to send empty or truncated data and potentially trigger S3 BadDigest errors.

The retry handling now rewinds file-like request bodies before retrying multipart POST and file-like PUT requests.

🔍 Diagnosis

Tenacity retried the request with the same stream object, which remained positioned at EOF after the first attempt. This affected both multipart and presigned artifact upload paths.

🔄 Changes

  • Rewind direct and tuple-form multipart file streams before retries.
  • Rewind file-like PUT bodies before retries.
  • Add regression tests covering all three request forms.

✔️ Checklist

  • Unit and integration tests passing. Relevant tests pass; the full suite has unrelated nightly-server compatibility failures.
  • Pre-commit hooks passing.
  • Quality checks passing.

Cover direct and tuple-form multipart POST files, along with file-like PUT request bodies
Rewind multipart POST files and file-like PUT bodies before Tenacity retries the request

Fixes #1002
@kzscisoft
kzscisoft merged commit 9013e51 into dev Sep 2, 2026
16 of 22 checks passed
@kzscisoft
kzscisoft deleted the james/fix_artifact_upload_retries branch September 2, 2026 09:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants