From 9b9b8cc83fc632c0591f05762f03dd0ef6c2f332 Mon Sep 17 00:00:00 2001 From: Prince Kumar Date: Fri, 19 Apr 2024 13:27:45 +0000 Subject: [PATCH 1/3] Adding info log for operation retry --- internal/storage/storageutil/custom_retry.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/internal/storage/storageutil/custom_retry.go b/internal/storage/storageutil/custom_retry.go index b95b030b6c..431de2aa52 100644 --- a/internal/storage/storageutil/custom_retry.go +++ b/internal/storage/storageutil/custom_retry.go @@ -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) return } @@ -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 } } From 20f3848091a55393d02b334e88b21688327dfc86 Mon Sep 17 00:00:00 2001 From: Prince Kumar Date: Fri, 19 Apr 2024 14:19:18 +0000 Subject: [PATCH 2/3] review comment --- internal/storage/storageutil/custom_retry.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/storage/storageutil/custom_retry.go b/internal/storage/storageutil/custom_retry.go index 431de2aa52..b5696a7f96 100644 --- a/internal/storage/storageutil/custom_retry.go +++ b/internal/storage/storageutil/custom_retry.go @@ -23,7 +23,7 @@ import ( func ShouldRetry(err error) (b bool) { b = storage.ShouldRetry(err) if b { - logger.Info("Retrying for the error: %w", err) + logger.Infof("Retrying for the error: %w", err) return } @@ -37,7 +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) + logger.Infof("Retrying for error-code 401: %w", err) return } } From a06468446340528e79faa1a5faf2edd067814c5b Mon Sep 17 00:00:00 2001 From: Prince Kumar Date: Fri, 19 Apr 2024 14:22:12 +0000 Subject: [PATCH 3/3] fixing formatting error --- internal/storage/storageutil/custom_retry.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/storage/storageutil/custom_retry.go b/internal/storage/storageutil/custom_retry.go index b5696a7f96..e82736ec94 100644 --- a/internal/storage/storageutil/custom_retry.go +++ b/internal/storage/storageutil/custom_retry.go @@ -23,7 +23,7 @@ import ( func ShouldRetry(err error) (b bool) { b = storage.ShouldRetry(err) if b { - logger.Infof("Retrying for the error: %w", err) + logger.Infof("Retrying for the error: %v", err) return } @@ -37,7 +37,7 @@ func ShouldRetry(err error) (b bool) { if typed, ok := err.(*googleapi.Error); ok { if typed.Code == 401 { b = true - logger.Infof("Retrying for error-code 401: %w", err) + logger.Infof("Retrying for error-code 401: %v", err) return } }