internal/process,server: fix unload regression (#828)

In v221 the shutdown behaviour was refactored so shutdown behaviour was
more reliable in stopping a process group. This exposed an existing bug
where the unload API had a timeout of 0 that snuck in during the big
refactor.

- set a default timeout of 10 seconds for unloads called via the API
- add logging around shutdown routine

updates: #807, #808
fixes: #827
This commit is contained in:
Benson Wong
2026-06-09 20:49:58 -07:00
committed by GitHub
parent 46cea36bc2
commit 44e1501e81
3 changed files with 12 additions and 4 deletions
+6 -1
View File
@@ -585,7 +585,12 @@ func (p *ProcessCommand) killProcess(cmd *exec.Cmd, cancel context.CancelFunc, c
// cannot block the run() goroutine; the gracefulTimeout + Process.Kill
// path below still guarantees teardown.
if cmd != nil {
go func() { _ = p.sendStopSignal(cmd) }()
go func() {
p.proxyLogger.Debugf("[%s] sending stop signal with timeout %v", p.id, gracefulTimeout)
if err := p.sendStopSignal(cmd); err != nil {
p.proxyLogger.Warnf("[%s] stop signal failed: %v", p.id, err)
}
}()
}
timer := time.NewTimer(gracefulTimeout)