update comment

Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>
(cherry picked from commit 9135eab27e)
This commit is contained in:
Jörn Friedrich Dreyer
2026-04-28 13:03:40 +02:00
committed by Ralf Haferkamp
parent 2ef5d1289d
commit df4bc7c1d8

View File

@@ -434,11 +434,8 @@ func Start(ctx context.Context, o ...Option) error {
// prepare the set of services to run
s.generateRunSet(s.cfg)
// There are reasons not to do this, but we have race conditions ourselves. Until we resolve them, mind the following disclaimer:
// Calling ServeBackground will CORRECTLY start the supervisor running in a new goroutine. It is risky to directly run
// go supervisor.Serve()
// because that will briefly create a race condition as it starts up, if you try to .Add() services immediately afterward.
// https://pkg.go.dev/github.com/thejerf/suture/v4@v4.0.0#Supervisor
// We need to control the order in which services are started and shut down,
// so we need a backgroud context that will outlive the service execution.
go s.Supervisor.ServeBackground(context.Background())
for i, service := range s.Services {