From 669234ec198530c23d67fb126a0ed7e82e04d6bc Mon Sep 17 00:00:00 2001 From: Nick Thomas Date: Fri, 30 Apr 2021 13:18:49 +0100 Subject: Don't finish the opentracing span early Calling finished() in `ContextWithCorrelationID` breaks opentracing, since it expects us to call it just before exiting, and this defer runs on function completion. All existing users of ContextWithCorrelationID already `defer finish()` themselves, so this call is entirely surplus to requirements. --- internal/command/command.go | 1 - 1 file changed, 1 deletion(-) (limited to 'internal/command') diff --git a/internal/command/command.go b/internal/command/command.go index bb430b7..97b24ba 100644 --- a/internal/command/command.go +++ b/internal/command/command.go @@ -53,7 +53,6 @@ func New(e *executable.Executable, arguments []string, env sshenv.Env, config *c // generated. func ContextWithCorrelationID() (context.Context, func()) { ctx, finished := tracing.ExtractFromEnv(context.Background()) - defer finished() correlationID := correlation.ExtractFromContext(ctx) if correlationID == "" { -- cgit v1.2.1