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

Adding info log for operation retry #1854

Merged
merged 3 commits into from
Apr 19, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions internal/storage/storageutil/custom_retry.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,14 @@ package storageutil

import (
"cloud.google.com/go/storage"
"github.com/googlecloudplatform/gcsfuse/v2/internal/logger"
"google.golang.org/api/googleapi"
)

func ShouldRetry(err error) (b bool) {
b = storage.ShouldRetry(err)
if b {
logger.Info("Retrying for the error: %w", err)
raj-prince marked this conversation as resolved.
Show resolved Hide resolved
return
}

Expand All @@ -35,6 +37,7 @@ func ShouldRetry(err error) (b bool) {
if typed, ok := err.(*googleapi.Error); ok {
if typed.Code == 401 {
b = true
logger.Info("Retrying for error-code 401: %w", err)
return
}
}
Expand Down
Loading