From 0e8fd22f36b4fe536c02f705eb3e470b5e4d0068 Mon Sep 17 00:00:00 2001 From: riccardom Date: Thu, 18 Jun 2026 13:25:23 +0200 Subject: [PATCH] Highlight what signals that the sup is running (which means the Connection is running because of UP/auto start) --- client/internal/connect_lifecycle.go | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/client/internal/connect_lifecycle.go b/client/internal/connect_lifecycle.go index 284a8abcd..305f0b31a 100644 --- a/client/internal/connect_lifecycle.go +++ b/client/internal/connect_lifecycle.go @@ -95,7 +95,7 @@ func (s *supervisor) loop() { case opStop: s.handleStop(cmd) case opStatus: - cmd.reply <- (s.curStart != nil) + cmd.reply <- (s.isRunningInternal()) } case res := <-s.runEnded: // Run ended on its own, without an explicit Stop. @@ -105,7 +105,7 @@ func (s *supervisor) loop() { } func (s *supervisor) handleStart(cmd lifecycleCmd) { - if s.curStart != nil { + if s.isRunningInternal() { notify(cmd.done, errAlreadyRunning) return } @@ -145,7 +145,7 @@ func (s *supervisor) handleStop(cmd lifecycleCmd) { // error back to whoever asked to be notified of the start. func (s *supervisor) finishRun(err error) { s.runCancel = nil - if s.curStart != nil { + if s.isRunningInternal() { notify(s.curStart.done, err) s.curStart = nil } @@ -212,6 +212,10 @@ func (s *supervisor) isRunning() bool { } } +func (s *supervisor) isRunningInternal() bool { + return s.curStart != nil +} + // stop enqueues a stop and blocks until the in-flight run is fully torn down. func (s *supervisor) stop() error { done := make(chan error, 1)