Skip to content

Commit

Permalink
introspection: allow trace shutdown hook full timeout
Browse files Browse the repository at this point in the history
Signed-off-by: Hank Donnay <hdonnay@redhat.com>
  • Loading branch information
hdonnay committed Jul 23, 2024
1 parent 76a5d50 commit 8e1a7bd
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion introspection/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,8 @@ func New(ctx context.Context, conf *config.Config, health func() bool) (*Server,
)
otel.SetTracerProvider(tp)
i.Server.RegisterOnShutdown(func() {
ctx, cancel := context.WithTimeout(ctx, 5*time.Second)
zlog.Info(ctx).Msg("shutting down trace provider")
ctx, cancel := context.WithTimeout(context.WithoutCancel(ctx), 5*time.Second)
defer cancel()
if err := tp.Shutdown(ctx); err != nil {
zlog.Error(ctx).Err(err).Msg("error shutting down trace provider")
Expand Down

0 comments on commit 8e1a7bd

Please sign in to comment.