diff --git a/node/pkg/common/scissors.go b/node/pkg/common/scissors.go index f5cc06ba57..8c17e42a70 100644 --- a/node/pkg/common/scissors.go +++ b/node/pkg/common/scissors.go @@ -65,13 +65,12 @@ func StartRunnable(ctx context.Context, errC chan error, catchPanics bool, name default: err = fmt.Errorf("%s: %v", name, x) } + ScissorsPanicsCaught.WithLabelValues(name).Inc() // We don't want this to hang if the listener has already gone away. select { case errC <- err: // Note on channel capacity: intentional best-effort: silently drop if the listener has already gone away default: } - ScissorsPanicsCaught.WithLabelValues(name).Inc() - } }() } @@ -83,11 +82,11 @@ func StartRunnable(ctx context.Context, errC chan error, catchPanics bool, name func startRunnable(ctx context.Context, errC chan error, name string, runnable supervisor.Runnable) { err := runnable(ctx) if err != nil { + ScissorsErrorsCaught.WithLabelValues(name).Inc() // We don't want this to hang if the listener has already gone away. select { case errC <- err: // Note on channel capacity: intentional best-effort: silently drop if the listener has already gone away default: } - ScissorsErrorsCaught.WithLabelValues(name).Inc() } }