Skip to content

Add AttemptDelay between check retries and event-wide attempt defaults - #178

Open
tire-fire wants to merge 3 commits into
dbaseqp:mainfrom
tire-fire:feat/attempt-delay
Open

tire-fire wants to merge 3 commits into
dbaseqp:mainfrom
tire-fire:feat/attempt-delay

Conversation

@tire-fire

@tire-fire tire-fire commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #177.

Summary

  • AttemptDelay: seconds the runner waits before retrying a failed attempt. It can be set per check or as an event-wide default in [MiscSettings]. The runner skips a retry that couldn't start before the round deadline, and stops waiting if it's shutting down.
  • Attempts can now also be set event-wide in [MiscSettings]; a value set on a check still wins. Negative values are rejected.
  • Config validation rejects any check whose worst case can't finish in the shortest round: Attempts * Timeout + (Attempts - 1) * AttemptDelay must be less than Delay - Jitter.
  • README documents Attempts/AttemptDelay in [MiscSettings] and in the per-check property table (attempts wasn't documented before).
  • Separate commit: stale entries in the Redis results queue are now cleared at round start along with stale tasks. After a mid-round restart the next round reuses the round ID, and leftover results from the interrupted round were being counted as the new round's.

With the defaults (Attempts = 1, AttemptDelay = 0) behavior is unchanged.

Tests

  • engine/config/attempt_config_test.go: a rapid property test that a check is accepted exactly when its attempt budget fits in Delay - Jitter and receives the event defaults; per-check values aren't overridden; Attempts defaults to 1; negative values are rejected.
  • runner/runner_test.go: waitForRetry waits the delay, skips when the deadline is too close, and returns on cancellation.
  • engine/engine_test.go: TestRvb_IgnoresStaleResultsFromRestartedRound fails without the fix and passes with it.
  • The full suite, go vet and golangci-lint pass.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Retries fire immediately, so they can't ride out brief service restarts

1 participant