A queue worker allows three total attempts to call an endpoint. Its SDK allows three retries after the initial request. With one SDK call per worker attempt and no other retry layer, the worst case is twelve network attempts for one job: three times four. A dashboard counting only worker attempts can show three while the remote endpoint saw twelve.
Build an attempt budget
Write down whether each setting means total attempts or additional retries. Include the queue's redeliveries and any fan-out from the handler. A product of layer caps is an upper bound only if every relevant layer is bounded and the calls follow that nesting pattern. A job with unbounded requeue has no finite bound from its SDK settings alone.
Give the logical operation a stable identifier. Give each actual transmission a separate attempt identifier, and record the terminal reason. A transport attempt does not always become a billed inference. For a cost bound, use the applicable pricing model, input and output limits and tool-call charges. For operational measurements, compare individual request receipts with the provider's usage records.
Test at the transport boundary
Use a local stub and count received requests. First, have every attempt produce a retryable error. The example cap should permit at most twelve transmissions. Then disable SDK retries and leave the wrapper at three total: the bound becomes three. On success on the first call, the observed count should be one under either configuration. Add a retry hint longer than the remaining job deadline and confirm that the worker stops instead of scheduling another attempt outside the budget.
For a side-effecting endpoint, the presence of an attempt budget alone cannot justify repeating an ambiguous write. Apply the endpoint's documented idempotency contract or reconcile what happened. Keep that decision separate from the limit on how many attempts the process could otherwise afford.
This article was created with AI assistance.
Top comments (0)