Retry pipeline
Checkout requests that fail with a transient gateway error are re-queued by the retry pipeline. The pipeline owns the attempt counter, the delay schedule, and the dead-letter handoff. checkout/retry.ts:12-48
Flow
Each attempt is scheduled by checkout/schedule.ts:7-31. The scheduler reads the attempt number from the job payload and computes the next delay before handing the job back to the queue.
Delay schedule
| Attempt | Delay | Source |
|---|---|---|
| 1 | 1 s | schedule.ts:14 |
| 2 | 2 s | schedule.ts:15 |
| 3 | 4 s | schedule.ts:16 |
After the third attempt the job is moved to the dead-letter topic and an alert is raised. checkout/deadletter.ts:3-22
Configuration
The maximum attempt count and base delay are read from config/retry.yaml:1-9 at startup. Changing them requires a restart of the checkout service; there is no hot reload.
The gateway client wraps every call in the same retry policy, so a single configuration change affects all upstream requests.
Gateway client
The gateway client sends card authorizations to the payment provider and applies the shared retry policy. It never retries a request that has already been acknowledged by the provider. gateway/client.ts:18-64
Backoff
Transient failures use exponential backoff with jitter, starting at one second. The retry count is capped by the same value the retry pipeline reads from configuration. gateway/backoff.ts:5-27
Errors
Rate-limit responses are treated as transient; validation errors are returned to the caller immediately without a retry.