From a29f9112726b64a421d138f8997f9ccf400a0e64 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Friedrich=20Dreyer?= Date: Thu, 25 Sep 2025 14:30:56 +0200 Subject: [PATCH] let the runtime always create a cancel context MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Jörn Friedrich Dreyer --- opencloud/pkg/runtime/service/service.go | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/opencloud/pkg/runtime/service/service.go b/opencloud/pkg/runtime/service/service.go index d4281bf11..58b86eca1 100644 --- a/opencloud/pkg/runtime/service/service.go +++ b/opencloud/pkg/runtime/service/service.go @@ -7,7 +7,6 @@ import ( "net" "net/http" "net/rpc" - "os/signal" "sort" "strings" "sync" @@ -360,12 +359,9 @@ func Start(ctx context.Context, o ...Option) error { return err } - // cancel the context when a signal is received. - var cancel context.CancelFunc - if ctx == nil { - ctx, cancel = signal.NotifyContext(context.Background(), runner.StopSignals...) - defer cancel() - } + // create a context that will be cancelled when too many backoff cycles on one of the services happens + ctx, cancel := context.WithCancel(ctx) + defer cancel() // tolerance controls backoff cycles from the supervisor. tolerance := 5