From 815fa429890a74b0cbfcea72c025bd9b437dbd9d Mon Sep 17 00:00:00 2001 From: Christos Kalkanis Date: Wed, 5 Feb 2025 01:01:46 -0700 Subject: [PATCH] processmanager: Fix process exit regression (#337) (#338) Co-authored-by: Florian Lehner --- processmanager/processinfo.go | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/processmanager/processinfo.go b/processmanager/processinfo.go index 8aaa6a96..683ea21a 100644 --- a/processmanager/processinfo.go +++ b/processmanager/processinfo.go @@ -530,15 +530,14 @@ func (pm *ProcessManager) processPIDExit(pid libpf.PID) { log.Debugf("Skip process exit handling for unknown PID %d", pid) return } - if pm.interpreterTracerEnabled && len(pm.interpreters[pid]) > 0 { - // ProcessPIDExit may be called multiple times in short succession - // for the same PID, don't update exitKTime if we've previously recorded it. - if _, pidExitProcessed := pm.exitEvents[pid]; !pidExitProcessed { - pm.exitEvents[pid] = exitKTime - } else { - log.Debugf("Skip duplicate process exit handling for PID %d", pid) - return - } + + // ProcessPIDExit may be called multiple times in short succession + // for the same PID, don't update exitKTime if we've previously recorded it. + if _, pidExitProcessed := pm.exitEvents[pid]; !pidExitProcessed { + pm.exitEvents[pid] = exitKTime + } else { + log.Debugf("Skip duplicate process exit handling for PID %d", pid) + return } // Delete all entries we have for this particular PID from pid_page_to_mapping_info.