From 75b71766ab1615dd2b127cb96743a3323ae70853 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 3 Dec 2024 06:16:22 +0000 Subject: [PATCH] chore(deps): bump github.com/thejerf/suture/v4 from 4.0.5 to 4.0.6 Bumps [github.com/thejerf/suture/v4](https://github.com/thejerf/suture) from 4.0.5 to 4.0.6. - [Commits](https://github.com/thejerf/suture/compare/v4.0.5...v4.0.6) --- updated-dependencies: - dependency-name: github.com/thejerf/suture/v4 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- go.mod | 2 +- go.sum | 4 ++-- vendor/github.com/thejerf/suture/v4/supervisor.go | 15 +++++++++------ vendor/modules.txt | 2 +- 4 files changed, 13 insertions(+), 10 deletions(-) diff --git a/go.mod b/go.mod index b188fd5027..2705412087 100644 --- a/go.mod +++ b/go.mod @@ -82,7 +82,7 @@ require ( github.com/spf13/cobra v1.8.1 github.com/stretchr/testify v1.10.0 github.com/test-go/testify v1.1.4 - github.com/thejerf/suture/v4 v4.0.5 + github.com/thejerf/suture/v4 v4.0.6 github.com/tidwall/gjson v1.18.0 github.com/tus/tusd/v2 v2.6.0 github.com/unrolled/secure v1.16.0 diff --git a/go.sum b/go.sum index 09281add43..16b8b6f394 100644 --- a/go.sum +++ b/go.sum @@ -1086,8 +1086,8 @@ github.com/test-go/testify v1.1.4 h1:Tf9lntrKUMHiXQ07qBScBTSA0dhYQlu83hswqelv1iE github.com/test-go/testify v1.1.4/go.mod h1:rH7cfJo/47vWGdi4GPj16x3/t1xGOj2YxzmNQzk2ghU= github.com/thanhpk/randstr v1.0.6 h1:psAOktJFD4vV9NEVb3qkhRSMvYh4ORRaj1+w/hn4B+o= github.com/thanhpk/randstr v1.0.6/go.mod h1:M/H2P1eNLZzlDwAzpkkkUvoyNNMbzRGhESZuEQk3r0U= -github.com/thejerf/suture/v4 v4.0.5 h1:F1E/4FZwXWqvlWDKEUo6/ndLtxGAUzMmNqkrMknZbAA= -github.com/thejerf/suture/v4 v4.0.5/go.mod h1:gu9Y4dXNUWFrByqRt30Rm9/UZ0wzRSt9AJS6xu/ZGxU= +github.com/thejerf/suture/v4 v4.0.6 h1:QsuCEsCqb03xF9tPAsWAj8QOAJBgQI1c0VqJNaingg8= +github.com/thejerf/suture/v4 v4.0.6/go.mod h1:gu9Y4dXNUWFrByqRt30Rm9/UZ0wzRSt9AJS6xu/ZGxU= github.com/tidwall/gjson v1.18.0 h1:FIDeeyB800efLX89e5a8Y0BNH+LOngJyGrIWxG2FKQY= github.com/tidwall/gjson v1.18.0/go.mod h1:/wbyibRr2FHMks5tjHJ5F8dMZh3AcwJEMf5vlfC0lxk= github.com/tidwall/match v1.1.1 h1:+Ho715JplO36QYgwN9PGYNhgZvoUSc9X2c80KVTi+GA= diff --git a/vendor/github.com/thejerf/suture/v4/supervisor.go b/vendor/github.com/thejerf/suture/v4/supervisor.go index 0ab5f99d2b..585bf16379 100644 --- a/vendor/github.com/thejerf/suture/v4/supervisor.go +++ b/vendor/github.com/thejerf/suture/v4/supervisor.go @@ -120,10 +120,8 @@ following: exits it - When a service fails to stop -A slog-based EventHook is provided in the submodule sutureslog. Note -that it is a separate Go module, in order to avoid imposing a Go 1.21 -requirement on this module, so a separate go get step will be -necessary to use it. +A default hook for slog is provided with the [sutureslog +module](https://github.com/thejerf/sutureslog). The failureRate, failureThreshold, and failureBackoff controls how failures are handled, in order to avoid the supervisor failure case where the @@ -365,7 +363,8 @@ func (s *Supervisor) Serve(ctx context.Context) error { _, monitored := s.services[msg.id] if monitored { cancel := s.cancellations[msg.id] - if isErr(msg.err, ErrDoNotRestart) || isErr(msg.err, context.Canceled) || isErr(msg.err, context.DeadlineExceeded) { + + if isErr(msg.err, ErrDoNotRestart) || ctx.Err() != nil { delete(s.services, msg.id) delete(s.cancellations, msg.id) go cancel() @@ -377,7 +376,11 @@ func (s *Supervisor) Serve(ctx context.Context) error { return msg.err } } else { - s.handleFailedService(ctx, msg.id, msg.err, nil, false) + err := msg.err + if isErr(msg.err, context.DeadlineExceeded) || isErr(msg.err, context.Canceled) { + err = fmt.Errorf("from some other context, not the service's context, so service is being restarted: %w", msg.err) + } + s.handleFailedService(ctx, msg.id, err, nil, false) } } case addService: diff --git a/vendor/modules.txt b/vendor/modules.txt index 4b8ac2e34d..d5d0f4e7fc 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -1822,7 +1822,7 @@ github.com/tchap/go-patricia/v2/patricia # github.com/test-go/testify v1.1.4 ## explicit github.com/test-go/testify/require -# github.com/thejerf/suture/v4 v4.0.5 +# github.com/thejerf/suture/v4 v4.0.6 ## explicit; go 1.9 github.com/thejerf/suture/v4 # github.com/tidwall/gjson v1.18.0