You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Do not retry uploads with non-replayable file streams - #738
After an internal server error, upload_files() could retry a non-seekable file after it had already been consumed. The second multipart request could then carry an empty file and still report success.
Keep the existing retry policy for replayable bodies. If a stream cannot be rewound, surface the original error instead. Non-seekable streams still work on a successful first attempt.
Validated with local HTTPX multipart requests: 13 targeted tests passed, including 6 retry cases. Those 6 also passed from a locally installed wheel and with HTTPX 0.23.0 and Tenacity 8.2.2 on Python 3.12.
No actionable comments were generated in the recent review.
Walkthrough
upload_files now retries internal server errors only when every file body can be read again. The retry delay and five-attempt limit remain unchanged. Tests cover replayable and non-seekable bodies, path conflicts, and retry exhaustion.
Changes: Upload retry behavior
Layer / File(s)
Summary
Retry eligibility and validation dagshub/upload/wrapper.py, tests/test_upload_retry.py
The retry predicate checks for an internal server error and confirms that every file body can be reused. Tests cover successful replay, non-seekable streams, path conflicts, and five consecutive server errors.
Uploads no longer retry a non-seekable file stream after it has been consumed, so a retry cannot send an empty file and report success. Replayable bodies keep the existing retry behavior. No actionable merge risk remains.
Pre-merge checks: 4
Check name
Status
Explanation
Title check
The title names the main change: upload retries are blocked for non-replayable file streams. The raw summary confirms that upload_files now retries only when every file body can be rewound, and the te…
Description check
The description states the problem (a consumed non-seekable file could be retried and sent empty), the fix (keep retries for replayable bodies and surface the original error otherwise), and the valida…
Linked Issues check
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
Check skipped because no linked issues were found for this pull request.
Full details: Title check
Explanation
The title names the main change: upload retries are blocked for non-replayable file streams. The raw summary confirms that upload_files now retries only when every file body can be rewound, and the tests cover this case. The title is specific and matches the changeset.
Full details: Description check
Explanation
The description states the problem (a consumed non-seekable file could be retried and sent empty), the fix (keep retries for replayable bodies and surface the original error otherwise), and the validation performed. It relates directly to the changeset.
Finishing Touches
Generate unit tests (beta)
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
A rabbit checks each stream with care, Then sends it back through open air. Bytes and strings can make the trip, Seekable files can take the skip. Five tries, then paws rest there.
Recent review info
Run configuration
Source mode: Auto
Repository: Unavailable
Branch: Unavailable
File: No configuration file from this repository applied
Commit: Unavailable
Layers: Organization UI
Review profile: CHILL
Plan: Advanced
Run ID: 9f987461-ec29-46ce-95a4-224fb69c8472
Commits
Reviewing files that changed from the base of the PR and between 4f7d78a and b14c506.
Files selected for processing: 2
dagshub/upload/wrapper.py
tests/test_upload_retry.py
Included review availability: This review used your included allowance. Your plan provides up to 2 included reviews per hour; 1 remain after this review.
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
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.
Refs #225.
After an internal server error,
upload_files()could retry a non-seekable file after it had already been consumed. The second multipart request could then carry an empty file and still report success.Keep the existing retry policy for replayable bodies. If a stream cannot be rewound, surface the original error instead. Non-seekable streams still work on a successful first attempt.
Validated with local HTTPX multipart requests: 13 targeted tests passed, including 6 retry cases. Those 6 also passed from a locally installed wheel and with HTTPX 0.23.0 and Tenacity 8.2.2 on Python 3.12.