mirror of
https://github.com/weaveworks/scope.git
synced 2026-07-28 01:31:17 +00:00
fix(probe/ebpf): feed initial connections synchronously on restart
If we run `getInitialState()` async there is some chance we will see another ebpf failure and call `useProcfs()` before `getInitialState()` gets to the last line, whereupon it will crash on nil pointer. Also it seems pointless to call `performEbpfTrack()` without waiting for something to feed in, so I suspect this is what the original author had in mind. It will slow down this one `Report()` on machines with a lot of processes or connections, but ebpfTracker restart is supposed to be a rare event.
This commit is contained in:
@@ -86,7 +86,7 @@ func (t *connectionTracker) ReportConnections(rpt *report.Report) {
|
||||
log.Warnf("ebpf tracker died, restarting it")
|
||||
err := t.ebpfTracker.restart()
|
||||
if err == nil {
|
||||
go t.getInitialState()
|
||||
t.getInitialState()
|
||||
t.performEbpfTrack(rpt, hostNodeID)
|
||||
return
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user