Table of Contents

Class JobRetryBackoff

Namespace
MailFathom.Application.Jobs.Execution
Assembly
MailFathom.Application.dll

Decides how long a job waits before it becomes claimable again after a transient failure.

public static class JobRetryBackoff
Inheritance
JobRetryBackoff
Inherited Members

Remarks

This is the queue's own backoff, and it is a different decision from the one an adapter's resilience pipeline makes. The pipeline decides whether one call to a dependency is worth repeating within a single attempt and has already spent that budget by the time a handler raises; this decides when the whole job is worth attempting again, minutes later and in a process that need not be the one that failed. The two never wrap each other, which is what keeps the attempt counts from multiplying into a retry storm.

The delay doubles per attempt and is drawn from a range rather than computed exactly. Jobs that failed together failed on the same dependency, and an exact delay would return every one of them to it in the same instant on every later attempt. Half the ceiling is the floor of the draw, so a delay always at least halves the rate of approach while never exceeding the configured maximum.

Methods

DelayBeforeNextAttempt(TimeSpan, TimeSpan, int)

Computes how long a job waits before its next attempt.