diff --git a/modules/mesh-delivery-builder/internal/build/askagain.go b/modules/mesh-delivery-builder/internal/build/askagain.go index a7d6cd6..0a7e2a9 100644 --- a/modules/mesh-delivery-builder/internal/build/askagain.go +++ b/modules/mesh-delivery-builder/internal/build/askagain.go @@ -326,10 +326,12 @@ func (b *Builder) answer(ctx context.Context, l *lane, ask delivery.StepAsk, ask if bound := b.declineBound(); now.Sub(firstDecline) > bound { return step, ask, fmt.Errorf("the ask %s of %s was declined for %s and no build node took it: %s", ask.ID, l.module, bound.Round(time.Second), declinedWords(declines)) } - select { - case <-ctx.Done(): + // The pause is a context's bound, not a timer (ADR 0437 ยง8). + pause, stop := context.WithTimeout(ctx, b.declinePause()) + <-pause.Done() + stop() + if ctx.Err() != nil { return step, ask, ctx.Err() - case <-time.After(b.declinePause()): } old := ask.ID ask.ID, ask.At = buildstep.NewID(), time.Now()