Problem
11 call sites across cmd/, internal/, and pkg/ use context.TODO() in places where the intent is clearly a long-lived background context:
bgCtx := context.TODO() // in server startup, background goroutines, cache callbacks
context.TODO() signals "I haven't decided what context to use yet" — a placeholder for work-in-progress. These sites are all settled background operations where context.Background() is the semantically correct and final choice.
Proposed fix
Replace context.TODO() → context.Background() in:
- Server startup sequences (
cmd/gc, agent_gateway, symbolizer)
- Background processing loops (
binaryprocessor, offline_processing)
- Cache eviction callbacks (
dso/map.go)
- Long-running service goroutines (
kafka/producer, s3/http_proxy)
No behaviour change at runtime — purely a correctness/readability fix.
Files affected
11 files in perforator/cmd/, perforator/internal/, perforator/pkg/
Problem
11 call sites across
cmd/,internal/, andpkg/usecontext.TODO()in places where the intent is clearly a long-lived background context:context.TODO()signals "I haven't decided what context to use yet" — a placeholder for work-in-progress. These sites are all settled background operations wherecontext.Background()is the semantically correct and final choice.Proposed fix
Replace
context.TODO()→context.Background()in:cmd/gc,agent_gateway,symbolizer)binaryprocessor,offline_processing)dso/map.go)kafka/producer,s3/http_proxy)No behaviour change at runtime — purely a correctness/readability fix.
Files affected
11 files in
perforator/cmd/,perforator/internal/,perforator/pkg/