remove panic() when cmd or process is nil

This commit is contained in:
Benson Wong
2025-02-07 14:00:32 -08:00
parent 09bdd86b54
commit eab9795bcc

View File

@@ -296,7 +296,8 @@ func (p *Process) stopCommand(sigtermTTL time.Duration) {
}() }()
if p.cmd == nil || p.cmd.Process == nil { if p.cmd == nil || p.cmd.Process == nil {
panic("this should not happen, cmd or cmd.Process is nil") fmt.Fprintf(p.logMonitor, "!!! process [%s] cmd or cmd.Process is nil", p.ID)
return
} }
p.cmd.Process.Signal(syscall.SIGTERM) p.cmd.Process.Signal(syscall.SIGTERM)