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.
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(storage): retry SignBlob call for URL signing #7862
feat(storage): retry SignBlob call for URL signing #7862
Changes from 25 commits
809530a
b250912
2bcb0cd
a315588
f701a10
a31e6ec
a93d0ec
f7d79c3
0d55821
3f5079e
9720b9b
2c935f4
8dc9eb1
bec1876
42526e7
d1f4b32
f1fe1e3
93a16be
18171d5
7048bbf
6f64bed
1ab9c96
4607e65
b8247f2
173d8bb
5efdf4b
031c0a7
69eaeb1
cf9fd55
e9c05ce
a0fb38d
9b67a34
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
I'm confused; shouldn't the retryDecider decide max number of attempts?
Hmm the documentation on this trait is confusing that it uses maxAttempts but doesn't have it in the function signature:
https://github.com/googleapis/google-cloud-php/blob/main/Storage/src/Connection/RetryTrait.php#L190
@bshaffer am I misunderstanding this? i'm not up-to-date on PHP
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.
You're right, I couldn't find a maxRetries or maxAttempts option in the documentation either. That's why I added the maxAttempt directly.
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.
I'll approve from my side; just need @bshaffer to weigh in here when he has a chance.
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.
If I'm reading this correctly, the current code does not have any check for
maxAttempts
, so it seems like this would result in an infinite loop. There is no test case for a retryable error meeting its max attempts. I feel like we definitely need a retry max attempts.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.
generally speaking, calling private methods is a bad way to test. It would be better to mock the
Connection
class being passed tov2Sign
, in a way that can trigger the retry.I can work with you on how to write tests like that, if you'd like.
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.
That's a great point. Mocking the Connection class to trigger retries is a much more robust and testable approach. I'd be happy to work with you on implementing this.