Skip to content

S3 part upload retries#25

Open
amanda-ruby wants to merge 2 commits intoSendSafely:masterfrom
amanda-ruby:s3-part-upload-retries
Open

S3 part upload retries#25
amanda-ruby wants to merge 2 commits intoSendSafely:masterfrom
amanda-ruby:s3-part-upload-retries

Conversation

@amanda-ruby
Copy link
Copy Markdown

@amanda-ruby amanda-ruby commented May 1, 2026

In testing the upload of large files (>= 30 GB) I noticed that the chunk upload to S3 would have a "Connection reset by peer" error for one of the (many, many) parts, scuttling the upload.

This pull request enhances the reliability of S3 file part uploads in the sendsafely/utilities.py module by adding retry logic with exponential backoff. This change helps handle transient network errors more gracefully, reducing the chance of upload failures due to temporary issues.

Improvements to S3 upload reliability:

  • Added retry logic with exponential backoff to _upload_file_part_to_s3, retrying up to 5 times with increasing delays (up to 180 seconds) on connection errors, timeouts, or chunked encoding errors. This also includes user feedback via sys.stdout on each retry attempt.

Dependency updates:

  • Imported the sys and time modules to support the new retry and logging functionality.

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.

1 participant