Skip to content
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): export ShouldRetry #6370

Merged
merged 2 commits into from
Aug 11, 2022
Merged

Conversation

tritone
Copy link
Contributor

@tritone tritone commented Jul 19, 2022

Export the default func to determine whether an error is retryable.
This makes it easier for users to use the WithErrorFunc option
without copying a lot of code.

Fixes #6362

Export the default func to determine whether an error is retryable.
This makes it easier for users to use the WithErrorFunc option
without copying a lot of code.

Fixes googleapis#6362
@tritone tritone requested review from a team as code owners July 19, 2022 18:54
@product-auto-label product-auto-label bot added size: m Pull request size is medium. api: storage Issues related to the Cloud Storage API. labels Jul 19, 2022
@@ -1229,7 +1229,7 @@ func (r *gRPCReader) Close() error {
// an attempt to reopen the stream.
func (r *gRPCReader) recv() (*storagepb.ReadObjectResponse, error) {
msg, err := r.stream.Recv()
if err != nil && shouldRetry(err) {
if err != nil && ShouldRetry(err) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note: ShouldRetry should not be referenced directly here; instead we should be using the configured value from the retry configuration passed through the interface. Will file a separate bug to fix this up. FYI @noahdietz

@tritone tritone merged commit 0da9ab0 into googleapis:main Aug 11, 2022
@tritone tritone deleted the export-should-retry branch August 11, 2022 22:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: storage Issues related to the Cloud Storage API. size: m Pull request size is medium.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

storage: export default shouldRetry function
2 participants