fix(Storage): ensure StorageClient retryStrategy is applied correctly to all operations - #9516
Open
salilg-eng wants to merge 1 commit into
Open
fix(Storage): ensure StorageClient retryStrategy is applied correctly to all operations#9516salilg-eng wants to merge 1 commit into
salilg-eng wants to merge 1 commit into
Conversation
|
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
Collaborator
|
Hello @salilg-eng! It seems like there are two different accounts in the commit history and it is detecting it as a non googler contribution, asking you to sign the CLA. Why is there a "actions-user" account in two of the commits? If we want to fix it, to my understanding we need to have only an approved account to be able to merge this :). |
kalragauri
approved these changes
Aug 21, 2026
salilg-eng
force-pushed
the
fix/storage-retry-bug
branch
from
August 24, 2026 05:32
44507df to
5feeb56
Compare
… to all operations
salilg-eng
force-pushed
the
fix/storage-retry-bug
branch
from
August 27, 2026 03:32
85996f0 to
8451f26
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.
Fixes #9334
The Problem:
When creating a StorageClient with a custom retryStrategy (like StorageClient::RETRY_ALWAYS), the strategy was being ignored for non-idempotent operations like deleting an object.
This happened because in Rest::send and Rest::headObject, the retry function (getRestRetryFunction) was being constructed before the client's retryStrategy was added to the request options. Due to this order of execution, it fell back to the default StorageClient::RETRY_IDEMPOTENT.
The Solution:
Moved the $options['retryStrategy'] ??= $this->retryStrategy; assignment up so it happens before getRestRetryFunction is called.
Added a new unit test (testAlwaysRetryStrategyWithNonIdempotentOpSuccessful) to verify that a non-idempotent operation (like delete) correctly respects RETRY_ALWAYS.
(Note: The previous test for this feature used createBucket, which is idempotent and always retries by default, which is why this bug slipped through initially).