Skip to content

feat(storage): export ShouldRetry#6370

Merged
tritone merged 2 commits intogoogleapis:mainfrom
tritone:export-should-retry
Aug 11, 2022
Merged

feat(storage): export ShouldRetry#6370
tritone merged 2 commits intogoogleapis:mainfrom
tritone:export-should-retry

Conversation

@tritone
Copy link
Copy Markdown
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 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
Comment thread storage/grpc_client.go
func (r *gRPCReader) recv() (*storagepb.ReadObjectResponse, error) {
msg, err := r.stream.Recv()
if err != nil && shouldRetry(err) {
if err != nil && ShouldRetry(err) {
Copy link
Copy Markdown
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