diff options
| author | Paul Buetow <paul@buetow.org> | 2026-05-13 19:38:09 +0300 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2026-05-13 19:38:09 +0300 |
| commit | 7b4f74ab11a2504d107372afebdfd77dec59ea42 (patch) | |
| tree | 5da7edf16a764442e3acee16bc68965b04c98727 /internal/runtime/runtime.go | |
| parent | f4a814df4e39ff5547a88d4f5d37ae6fe159cc76 (diff) | |
fix: stop BPF ring-buffer polling goroutine on trace end to prevent leak
setupEventChannel now returns the *bpf.RingBuffer handle alongside the
event channel. Both callers (runTraceWithContext, runHeadlessParquet)
defer rb.Stop() so the libbpfgo polling goroutine and C ring_buffer
struct are released promptly when the trace context is cancelled,
rather than waiting for bpfModule.Close() to eventually call rb.Close().
rb.Stop() and rb.Close() are both idempotent, so the double-call from
the defer and from bpfModule.Close() is safe.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Diffstat (limited to 'internal/runtime/runtime.go')
0 files changed, 0 insertions, 0 deletions
