From cfbff11825ed0c418d65e76201b20f0d1fa34481 Mon Sep 17 00:00:00 2001 From: Thom Carlin Date: Tue, 29 Oct 2024 11:55:07 -0400 Subject: [PATCH] Fix command error checking in 2 places --- pkg/workceptor/command.go | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/pkg/workceptor/command.go b/pkg/workceptor/command.go index efa6fcd6d..0db29f6c1 100644 --- a/pkg/workceptor/command.go +++ b/pkg/workceptor/command.go @@ -70,7 +70,10 @@ func termThenKill(cmd *exec.Cmd, doneChan chan bool) { if cmd.Process == nil { return } - _ = cmd.Process.Signal(os.Interrupt) + pserr := cmd.Process.Signal(os.Interrupt) + if pserr != nil { + MainInstance.nc.GetLogger().Warning("Error processing Interrupt Signal: %+v", pserr) + } select { case <-doneChan: return @@ -79,7 +82,10 @@ func termThenKill(cmd *exec.Cmd, doneChan chan bool) { } if cmd.Process != nil { MainInstance.nc.GetLogger().Info("sending SIGKILL to pid %d", cmd.Process.Pid) - _ = cmd.Process.Kill() + pkerr := cmd.Process.Kill() + if pkerr != nil { + MainInstance.nc.GetLogger().Warning("Error killing pid %d: %+v", cmd.Process.Pid, pkerr) + } } }