GeezerVison is showing github.com — fix(storage): preserve HTTP status for XML multipart upload errors so retries work by Dhriti07 · Pull Request #14804 · googleapis/google-cloud-java
Conversation
Dhriti07
commented
Oct 28, 2026
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
Summary
MultipartUploadClient (XML multipart upload API) never retried retryable HTTP responses such as 503 Service Unavailable, even for idempotent operations like uploadPart, despite default RetrySettings (maxAttempts: 6).
Root cause
MultipartUploadHttpRequestManager executes raw HttpRequests with setThrowExceptionOnExecuteError(true), so an error response surfaces as a plain HttpResponseException. Unlike HttpStorageRpc, MultipartUploadClientImpl did not translate that IOException, so it reached the catch-all in Retrying.DefaultRetrier, which calls StorageException.coalesce(e). coalesce is a generic fallback and (as documented) creates a StorageException with UNKNOWN_CODE (0). With code 0, DefaultStorageRetryStrategy cannot classify the error and returns NO_RETRY.
Fix
Wrap each MultipartUploadClientImpl operation so any IOException is converted via StorageException.translate(...) before reaching the retrier.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
gemini-code-assist[bot] reacted with eyes emoji
… retries work
MultipartUploadClientImpl sends raw XML API requests that throw a plain HttpResponseException on error. These were not translated, so the retrier's catch-all coalesced them into a StorageException with code 0, and the retry strategy could not classify them. As a result, retryable responses (408, 429, 5xx) were never retried, even for idempotent operations such as uploadPart, and callers saw getCode() == 0.
Translate IOExceptions via StorageException.translate inside each MultipartUploadClient operation, matching HttpStorageRpc, so the HTTP status code is preserved and retries follow the standard rules. createMultipartUpload remains non-idempotent and is not retried.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
This pull request updates MultipartUploadClientImpl to translate IOExceptions into StorageExceptions before they reach the retrier, ensuring that HTTP status codes are preserved and transient errors can be properly classified and retried. It also introduces a comprehensive integration test suite in ITMultipartUploadClientRetryTest.java to verify this retry behavior. Feedback on the tests suggests optimizing uploadPart_retriesAllRetryableStatusCodes by instantiating the FakeHttpServer once outside the loop to avoid the overhead of repeatedly starting and stopping the server.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Reviewers
+1 more reviewer
Reviewers whose approvals may not affect merge requirements
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Milestone
No milestone
Development
Successfully merging this pull request may close these issues.
Uh oh!
There was an error while loading. Please reload this page.
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.
|