From 02ed2b5a19314c35e0d29e13f5d434e3bce31e9c Mon Sep 17 00:00:00 2001 From: Egon Elbre Date: Wed, 15 Jan 2020 10:21:29 +0200 Subject: [PATCH] satellite/metainfo: disallow cancelling deletion request Change-Id: I05194d493632c9f454671ddf6b67b4901f2b7884 --- satellite/metainfo/metainfo.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/satellite/metainfo/metainfo.go b/satellite/metainfo/metainfo.go index 7e227549d..adf1e9440 100644 --- a/satellite/metainfo/metainfo.go +++ b/satellite/metainfo/metainfo.go @@ -27,6 +27,7 @@ import ( "storj.io/common/storj" "storj.io/common/sync2" "storj.io/storj/pkg/macaroon" + "storj.io/storj/private/context2" "storj.io/storj/private/dbutil" "storj.io/storj/satellite/accounting" "storj.io/storj/satellite/attribution" @@ -2275,6 +2276,9 @@ func (endpoint *Endpoint) DeleteObjectPieces( ) (err error) { defer mon.Task()(&ctx, projectID.String(), bucket, encryptedPath)(&err) + // We should ignore client cancelling and always try to delete segments. + ctx = context2.WithoutCancellation(ctx) + numOfSegments, err := endpoint.getObjectNumberOfSegments(ctx, projectID, bucket, encryptedPath) if err != nil { return err