From 9d062b37d7a2c3d8ec7d3d0c02731ef840891e57 Mon Sep 17 00:00:00 2001 From: jiuker <2818723467@qq.com> Date: Sat, 4 Mar 2023 15:56:53 +0800 Subject: [PATCH] return underlying error with BackendDown{} error (#16738) --- cmd/disk-cache.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/cmd/disk-cache.go b/cmd/disk-cache.go index 2c0e14e1a..c92773b1b 100644 --- a/cmd/disk-cache.go +++ b/cmd/disk-cache.go @@ -34,6 +34,7 @@ import ( "github.com/minio/minio/internal/hash" "github.com/minio/minio/internal/logger" "github.com/minio/minio/internal/sync/errgroup" + xnet "github.com/minio/pkg/net" "github.com/minio/pkg/wildcard" ) @@ -447,7 +448,10 @@ func (c *cacheObjects) GetObjectInfo(ctx context.Context, bucket, object string, return cachedObjInfo, nil } c.cacheStats.incMiss() - return ObjectInfo{}, BackendDown{} + if xnet.IsNetworkOrHostDown(err, false) { + return ObjectInfo{}, BackendDown{Err: err.Error()} + } + return ObjectInfo{}, err } // Reaching here implies cache miss c.cacheStats.incMiss()