diff --git a/cmd/buildctl/common/trace.go b/cmd/buildctl/common/trace.go index 96691d850..365cbc55d 100644 --- a/cmd/buildctl/common/trace.go +++ b/cmd/buildctl/common/trace.go @@ -3,12 +3,10 @@ package common import ( "context" "os" - "time" "github.com/moby/buildkit/util/appcontext" "github.com/moby/buildkit/util/tracing/delegated" "github.com/moby/buildkit/util/tracing/detect" - "github.com/pkg/errors" "github.com/urfave/cli/v3" "go.opentelemetry.io/otel/attribute" "go.opentelemetry.io/otel/codes" @@ -16,8 +14,6 @@ import ( "go.opentelemetry.io/otel/trace" ) -const exportTimeout = 50 * time.Millisecond - func AttachAppContext(app *cli.Command) error { baseCtx := appcontext.Context() @@ -79,13 +75,7 @@ func AttachAppContext(app *cli.Command) error { span.End() } - // Set a rather aggressive timeout for shutting down the tracer provider - // to ensure we don't stall on a non-responsive tracing endpoint for too long - // on shutdown. - ctx, cancel := context.WithTimeoutCause(appcontext.Shutdown(), exportTimeout, errors.WithStack(context.DeadlineExceeded)) - defer cancel() - - return tp.Shutdown(ctx) + return tp.Shutdown(context.TODO()) } return nil }