From 46ee87a0fc211dde6d503c32fc3a091edcb187db Mon Sep 17 00:00:00 2001 From: Karl Persson Date: Mon, 8 Apr 2024 10:25:24 +0200 Subject: [PATCH] Authn: Ignore context.Canceled errors when logging auth errors (#85707) Ignore context.Canceled errors when logging auth errors --- pkg/services/authn/authnimpl/service.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pkg/services/authn/authnimpl/service.go b/pkg/services/authn/authnimpl/service.go index 3fcf1856ac1..7b97a480a08 100644 --- a/pkg/services/authn/authnimpl/service.go +++ b/pkg/services/authn/authnimpl/service.go @@ -320,6 +320,10 @@ func (s *Service) SyncIdentity(ctx context.Context, identity *authn.Identity) er } func (s *Service) errorLogFunc(ctx context.Context, err error) func(msg string, ctx ...any) { + if errors.Is(err, context.Canceled) { + return func(msg string, ctx ...any) {} + } + l := s.log.FromContext(ctx) var grfErr errutil.Error