diff --git a/core/services/pipeline/runner.go b/core/services/pipeline/runner.go index 40444ffd3e0..1e2f6509a56 100644 --- a/core/services/pipeline/runner.go +++ b/core/services/pipeline/runner.go @@ -236,10 +236,16 @@ func init() { // results, even after context cancellation. func overtimeContext(ctx context.Context) (context.Context, context.CancelFunc) { if d, ok := ctx.Deadline(); ok { - // extend deadline - return context.WithDeadline(context.WithoutCancel(ctx), d.Add(overtime)) - } - // remove cancellation + // We do not use context.WithDeadline/Timeout in order to prevent the monitor hook from logging noisily, since + // we expect and want these operations to use most of their allotted time. + // TODO replace with custom thresholds: https://smartcontract-it.atlassian.net/browse/BCF-3252 + var cancel context.CancelFunc + ctx, cancel = context.WithCancel(context.WithoutCancel(ctx)) + t := time.AfterFunc(time.Until(d.Add(overtime)), cancel) + stop := context.AfterFunc(ctx, func() { t.Stop() }) + return ctx, func() { cancel(); stop() } + } + // do not propagate cancellation in any case return context.WithoutCancel(ctx), func() {} }