From 716a52f26143f756383e1b367bed18bee25ac21c Mon Sep 17 00:00:00 2001 From: poornas Date: Thu, 13 Feb 2020 15:32:26 -0800 Subject: [PATCH] Fix hang in cache copyobject call (#8993) Avoid GetObjectNInfo call from cache in CopyObjectHandler - in the case of server side copy with metadata replacement, the reader returned from cache is never consumed, but the net effect of GetObjectNInfo from cache layer, is cache holding a write lock to fill the cache. Subsequent stat operation on cache in CopyObject is not able to acquire a read lock, thus causing the hang. Fixes #8991 --- cmd/object-handlers.go | 3 --- 1 file changed, 3 deletions(-) diff --git a/cmd/object-handlers.go b/cmd/object-handlers.go index 40216a44e..5900a049f 100644 --- a/cmd/object-handlers.go +++ b/cmd/object-handlers.go @@ -812,9 +812,6 @@ func (api objectAPIHandlers) CopyObjectHandler(w http.ResponseWriter, r *http.Re cpSrcDstSame := isStringEqual(pathJoin(srcBucket, srcObject), pathJoin(dstBucket, dstObject)) getObjectNInfo := objectAPI.GetObjectNInfo - if api.CacheAPI() != nil { - getObjectNInfo = api.CacheAPI().GetObjectNInfo - } var lock = noLock if !cpSrcDstSame {