From 8b94cb22d318ce8d98497abe52b005a59e3872dd Mon Sep 17 00:00:00 2001 From: Leonard Lyubich Date: Thu, 2 Jun 2022 17:11:26 +0300 Subject: [PATCH] [#1471] eacl: Prevent aborting on local storage failure Request processing should not be interrupted in case of local storage failure since error case in normal for relay nodes. Signed-off-by: Leonard Lyubich --- pkg/services/object/acl/eacl/v2/headers.go | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/pkg/services/object/acl/eacl/v2/headers.go b/pkg/services/object/acl/eacl/v2/headers.go index 3cf51e934..43c57b300 100644 --- a/pkg/services/object/acl/eacl/v2/headers.go +++ b/pkg/services/object/acl/eacl/v2/headers.go @@ -11,7 +11,6 @@ import ( cid "github.com/nspcc-dev/neofs-sdk-go/container/id" eaclSDK "github.com/nspcc-dev/neofs-sdk-go/eacl" "github.com/nspcc-dev/neofs-sdk-go/object" - objectSDK "github.com/nspcc-dev/neofs-sdk-go/object" oid "github.com/nspcc-dev/neofs-sdk-go/object/id" "github.com/nspcc-dev/neofs-sdk-go/user" ) @@ -187,22 +186,19 @@ func (h *cfg) objectHeaders() ([]eaclSDK.Header, error) { } func (h *cfg) localObjectHeaders(cnr cid.ID, idObj *oid.ID) ([]eaclSDK.Header, error) { - var obj *objectSDK.Object - var err error - if idObj != nil { var addr oid.Address addr.SetContainer(cnr) addr.SetObject(*idObj) - obj, err = h.storage.Head(addr) + obj, err := h.storage.Head(addr) if err == nil { return headersFromObject(obj, cnr, idObj), nil } } // Still parse addressHeaders, because the errors is ignored in some places. - return addressHeaders(cnr, idObj), err + return addressHeaders(cnr, idObj), nil } func cidHeader(idCnr cid.ID) sysObjHdr {