From cd25b8b93557c29c0bd95f8cff30921aad5de163 Mon Sep 17 00:00:00 2001 From: Michael Schubert Date: Tue, 21 Mar 2017 13:57:20 +0100 Subject: [PATCH] endpoint/ebpf: implement stop Since d60874aca8dee7d4d0c1a1c28f3394e60a5c553b `connectionTracker` can fallback when the `EbpfTracker` died. Hence we only have to stop the `tracer` in `stop()`. This commit is also a fixup for d60874aca8dee7d4d0c1a1c28f3394e60a5c553b where we do a gentle fallback but never actually stop the tracer to stop polling. --- probe/endpoint/ebpf.go | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/probe/endpoint/ebpf.go b/probe/endpoint/ebpf.go index 69d7bad3a..6df90c3df 100644 --- a/probe/endpoint/ebpf.go +++ b/probe/endpoint/ebpf.go @@ -209,15 +209,8 @@ func (t *EbpfTracker) isDead() bool { } func (t *EbpfTracker) stop() { - // TODO: implement proper stopping logic - // - // Even if we stop the go routine, it's not enough since we disabled the - // async proc parser. We leave this uninmplemented for now because: - // - // * Ebpf parsing is optional (need to be enabled explicitly with - // --probe.ebpf.connections=true), if a user enables it we assume they - // check on the logs whether it works or not - // - // * It's unlikely that the ebpf tracker stops working if it started - // successfully and if it does, we probaby want it to fail hard + if t.tracer != nil { + t.tracer.Stop() + } + t.dead = true }