fix(storage): respect maxAttempts parameter in HTTP OpenWriter - #20153
Open
sahusneha2004 wants to merge 1 commit into
Open
fix(storage): respect maxAttempts parameter in HTTP OpenWriter#20153sahusneha2004 wants to merge 1 commit into
sahusneha2004 wants to merge 1 commit into
Conversation
sahusneha2004
commented
Jul 14, 2026
- Updates OpenWriter in http_client.go to track retry attempt counts and respect s.retry.maxAttempts.
- Formats error as 'storage: retry failed after N attempts; last error: ...' upon exceeding max attempts.
- Adds TestRetryConformance_MaxAttempts in retry_conformance_test.go to validate max_attempts behavior dynamically against retry_tests.json for both HTTP and gRPC transports.
Contributor
There was a problem hiding this comment.
Code Review
This pull request implements and tests maximum retry attempt limits for the storage client. Specifically, in storage/http_client.go, the OpenWriter method is updated to track retry attempts and enforce maxAttempts limits, wrapping the final error when the maximum attempts are exceeded. Additionally, new unit tests and conformance tests are added in storage/client_test.go and storage/retry_conformance_test.go to verify this behavior for both HTTP and gRPC transports. There are no review comments to address, and I have no additional feedback to provide.
sahusneha2004
force-pushed
the
fix-http-writer-max-attempts
branch
2 times, most recently
from
July 15, 2026 08:42
cda8809 to
75904de
Compare
In http_client.go, pass a unified retryFunc callback into call.WithRetry to enforce storage.ShouldRetry fallback and safely handle nil retry configs. In client_test.go, set googleapi.DefaultUploadChunkSize on openWriterParams in TestWriterRetryMaxAttemptsEmulated so media chunk buffering enables HTTP retries, and capture synchronous pw.Close() error propagation to correctly assert max attempt errors.
sahusneha2004
force-pushed
the
fix-http-writer-max-attempts
branch
from
July 15, 2026 08:54
75904de to
b43ff8a
Compare
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.