From 66afa16aed06fa6f78bdc97335288a96a17f3216 Mon Sep 17 00:00:00 2001 From: Harshavardhana Date: Fri, 4 Mar 2022 10:31:33 -0800 Subject: [PATCH] canceled PUTs throw frivolous logs (#14475) remote drives might throw frivolous logs, if the caller canceled the PUT operation in such scenarios there is no reason to log. --- cmd/xl-storage.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cmd/xl-storage.go b/cmd/xl-storage.go index 7e8632455..89dfcd23f 100644 --- a/cmd/xl-storage.go +++ b/cmd/xl-storage.go @@ -2039,7 +2039,8 @@ func skipAccessChecks(volume string) (ok bool) { // RenameData - rename source path to destination path atomically, metadata and data directory. func (s *xlStorage) RenameData(ctx context.Context, srcVolume, srcPath string, fi FileInfo, dstVolume, dstPath string) (err error) { defer func() { - if err != nil { + if err != nil && !contextCanceled(ctx) { + // Only log these errors if context is not yet canceled. logger.LogIf(ctx, fmt.Errorf("srcVolume: %s, srcPath: %s, dstVolume: %s:, dstPath: %s - error %v", srcVolume, srcPath, dstVolume, dstPath,