Commit 63c76368 authored by Mark Ward's avatar Mark Ward
Browse files

log when the waiting for the process to stop to help debug when other tasks...

log when the waiting for the process to stop to help debug when other tasks execute during this wait.
expire timer clear the timer reference because it will not be reused.
close will clean up expireTimer if calling code has not already done this.
parent 34a4a94f
...@@ -902,7 +902,12 @@ func (s *llmServer) Close() error { ...@@ -902,7 +902,12 @@ func (s *llmServer) Close() error {
if err := s.cmd.Process.Kill(); err != nil { if err := s.cmd.Process.Kill(); err != nil {
return err return err
} }
return s.cmd.Wait()
if err := s.cmd.Wait(); err != nil {
return err
}
slog.Debug("llama server stopped")
} }
return nil return nil
......
...@@ -250,6 +250,7 @@ func (s *Scheduler) processCompleted(ctx context.Context) { ...@@ -250,6 +250,7 @@ func (s *Scheduler) processCompleted(ctx context.Context) {
defer runner.refMu.Unlock() defer runner.refMu.Unlock()
if runner.expireTimer != nil { if runner.expireTimer != nil {
runner.expireTimer.Stop() runner.expireTimer.Stop()
runner.expireTimer = nil
} }
s.expiredCh <- runner s.expiredCh <- runner
}) })
...@@ -430,6 +431,10 @@ type runnerRef struct { ...@@ -430,6 +431,10 @@ type runnerRef struct {
// The refMu must already be held when calling unload // The refMu must already be held when calling unload
func (runner *runnerRef) unload() { func (runner *runnerRef) unload() {
if runner.expireTimer != nil {
runner.expireTimer.Stop()
runner.expireTimer = nil
}
if runner.llama != nil { if runner.llama != nil {
runner.llama.Close() runner.llama.Close()
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment