Cleanup callbacks pass context.Background() to calls that can block on the network: cmd/controller_start.go:96,99, cmd/agent_start.go:84,87, cmd/nats_server_start.go:80, cmd/start.go:185,188. metricsServer.Stop passes the context to meterProvider.Shutdown, and the tracer shutdown flushes an OTLP gRPC exporter when tracing uses otlp. The 10s budget in internal/cli/lifecycle.go:44-51 only wraps server.Stop, not these callbacks.
Impact: with the collector unreachable, SIGTERM may not terminate the process.
Fix: give cleanup a bounded context.WithTimeout.
Found in the September 2026 codebase review. Tracked in the review tracking issue.
Cleanup callbacks pass
context.Background()to calls that can block on the network:cmd/controller_start.go:96,99,cmd/agent_start.go:84,87,cmd/nats_server_start.go:80,cmd/start.go:185,188.metricsServer.Stoppasses the context tometerProvider.Shutdown, and the tracer shutdown flushes an OTLP gRPC exporter when tracing usesotlp. The 10s budget ininternal/cli/lifecycle.go:44-51only wrapsserver.Stop, not these callbacks.Impact: with the collector unreachable, SIGTERM may not terminate the process.
Fix: give cleanup a bounded
context.WithTimeout.Found in the September 2026 codebase review. Tracked in the review tracking issue.