From 36470072f4d7471993b057ec1880841178d6b64e Mon Sep 17 00:00:00 2001 From: Ingo Oppermann Date: Tue, 22 Jul 2025 16:02:09 +0200 Subject: [PATCH] Add timeout for waiting for state --- process/process.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/process/process.go b/process/process.go index c6645e37..a38c8a24 100644 --- a/process/process.go +++ b/process/process.go @@ -802,7 +802,12 @@ func (p *process) stop(wait bool, reason string) error { } // If the process in starting state, wait until the process has been started + start := time.Now() for { + if time.Since(start) > 5*time.Second { + return nil + } + if p.getState() == stateStarting { time.Sleep(100 * time.Millisecond) continue