From 08769f413f207f8df65f9a92f4ce877ee7acb36b Mon Sep 17 00:00:00 2001 From: Evgenii Stratonikov Date: Wed, 12 Apr 2023 16:54:04 +0300 Subject: [PATCH] Revert "[#135] acl: Add tracing spans" This reverts commit b2ca73054722fcc4f73746d75b1599377c82040a. --- pkg/services/object/acl/v2/service.go | 78 --------------------------- 1 file changed, 78 deletions(-) diff --git a/pkg/services/object/acl/v2/service.go b/pkg/services/object/acl/v2/service.go index 93c1c65f..6544d78d 100644 --- a/pkg/services/object/acl/v2/service.go +++ b/pkg/services/object/acl/v2/service.go @@ -6,7 +6,6 @@ import ( "fmt" objectV2 "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/object" - "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/pkg/tracing" "git.frostfs.info/TrueCloudLab/frostfs-node/pkg/core/container" "git.frostfs.info/TrueCloudLab/frostfs-node/pkg/core/netmap" "git.frostfs.info/TrueCloudLab/frostfs-node/pkg/services/object" @@ -112,14 +111,6 @@ func New(opts ...Option) Service { // Get implements ServiceServer interface, makes ACL checks and calls // next Get method in the ServiceServer pipeline. func (b Service) Get(request *objectV2.GetRequest, stream object.GetObjectStream) error { - spanClosed := false - _, span := tracing.StartSpanFromContext(stream.Context(), "checkACL") - defer func() { - if !spanClosed { - span.End() - } - }() - cnr, err := getContainerIDFromRequest(request) if err != nil { return err @@ -167,9 +158,6 @@ func (b Service) Get(request *objectV2.GetRequest, stream object.GetObjectStream return eACLErr(reqInfo, err) } - span.End() - spanClosed = true - return b.next.Get(request, &getStreamBasicChecker{ GetObjectStream: stream, info: reqInfo, @@ -189,14 +177,6 @@ func (b Service) Put() (object.PutObjectStream, error) { func (b Service) Head( ctx context.Context, request *objectV2.HeadRequest) (*objectV2.HeadResponse, error) { - spanClosed := false - _, span := tracing.StartSpanFromContext(ctx, "checkACL") - defer func() { - if !spanClosed { - span.End() - } - }() - cnr, err := getContainerIDFromRequest(request) if err != nil { return nil, err @@ -244,9 +224,6 @@ func (b Service) Head( return nil, eACLErr(reqInfo, err) } - span.End() - spanClosed = true - resp, err := b.next.Head(ctx, request) if err == nil { if err = b.checker.CheckEACL(resp, reqInfo); err != nil { @@ -258,14 +235,6 @@ func (b Service) Head( } func (b Service) Search(request *objectV2.SearchRequest, stream object.SearchStream) error { - spanClosed := false - _, span := tracing.StartSpanFromContext(stream.Context(), "checkACL") - defer func() { - if !spanClosed { - span.End() - } - }() - id, err := getContainerIDFromRequest(request) if err != nil { return err @@ -306,9 +275,6 @@ func (b Service) Search(request *objectV2.SearchRequest, stream object.SearchStr return eACLErr(reqInfo, err) } - span.End() - spanClosed = true - return b.next.Search(request, &searchStreamBasicChecker{ checker: b.checker, SearchStream: stream, @@ -319,14 +285,6 @@ func (b Service) Search(request *objectV2.SearchRequest, stream object.SearchStr func (b Service) Delete( ctx context.Context, request *objectV2.DeleteRequest) (*objectV2.DeleteResponse, error) { - spanClosed := false - _, span := tracing.StartSpanFromContext(ctx, "checkACL") - defer func() { - if !spanClosed { - span.End() - } - }() - cnr, err := getContainerIDFromRequest(request) if err != nil { return nil, err @@ -374,21 +332,10 @@ func (b Service) Delete( return nil, eACLErr(reqInfo, err) } - span.End() - spanClosed = true - return b.next.Delete(ctx, request) } func (b Service) GetRange(request *objectV2.GetRangeRequest, stream object.GetObjectRangeStream) error { - spanClosed := false - _, span := tracing.StartSpanFromContext(stream.Context(), "checkACL") - defer func() { - if !spanClosed { - span.End() - } - }() - cnr, err := getContainerIDFromRequest(request) if err != nil { return err @@ -436,9 +383,6 @@ func (b Service) GetRange(request *objectV2.GetRangeRequest, stream object.GetOb return eACLErr(reqInfo, err) } - span.End() - spanClosed = true - return b.next.GetRange(request, &rangeStreamBasicChecker{ checker: b.checker, GetObjectRangeStream: stream, @@ -449,14 +393,6 @@ func (b Service) GetRange(request *objectV2.GetRangeRequest, stream object.GetOb func (b Service) GetRangeHash( ctx context.Context, request *objectV2.GetRangeHashRequest) (*objectV2.GetRangeHashResponse, error) { - spanClosed := false - _, span := tracing.StartSpanFromContext(ctx, "checkACL") - defer func() { - if !spanClosed { - span.End() - } - }() - cnr, err := getContainerIDFromRequest(request) if err != nil { return nil, err @@ -504,21 +440,10 @@ func (b Service) GetRangeHash( return nil, eACLErr(reqInfo, err) } - span.End() - spanClosed = true - return b.next.GetRangeHash(ctx, request) } func (p putStreamBasicChecker) Send(ctx context.Context, request *objectV2.PutRequest) error { - spanClosed := false - _, span := tracing.StartSpanFromContext(ctx, "checkACL") - defer func() { - if !spanClosed { - span.End() - } - }() - body := request.GetBody() if body == nil { return errEmptyBody @@ -587,9 +512,6 @@ func (p putStreamBasicChecker) Send(ctx context.Context, request *objectV2.PutRe } } - span.End() - spanClosed = true - return p.next.Send(ctx, request) }