From 476086c066f49879f7d684a12046e96a8575a8db Mon Sep 17 00:00:00 2001 From: Benson Wong Date: Fri, 4 Oct 2024 21:38:29 -0700 Subject: [PATCH] Add Cmd.Wait() to prevent creation of zombie child processes see: #1 --- proxy/manager.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/proxy/manager.go b/proxy/manager.go index 38d6a08..21adc30 100644 --- a/proxy/manager.go +++ b/proxy/manager.go @@ -57,6 +57,9 @@ func (pm *ProxyManager) swapModel(requestedModel string) error { // kill the current running one to swap it if pm.currentCmd != nil { pm.currentCmd.Process.Signal(syscall.SIGTERM) + + // wait for it to end + pm.currentCmd.Process.Wait() } pm.currentConfig = modelConfig