Menu

1 / 2

A Retry Is Not a Repeat: Five Idempotency Myths Behind a Model-Backed Endpoint

DEV Community·Jordan Huang·9 days ago
#ARFBR39q
#dev#self#effects#retry#timeout
Reading 0:00
15s threshold

Your endpoint returned one 200. How many times did the model actually run?

That question is the whole article. Retries are invisible in your logs. They show up in your data.

I see the same five claims in code review. All five sound reasonable. Four of them are wrong in ways that corrupt state.

Here is a lab you can run in ten minutes. It counts effects, not responses.

Myth 1: "A timeout means the request never arrived"

No. A timeout is a client-side observation. It says nothing about the server.

The request may be queued, half-processed, or finished with the response lost on the way back. RFC 9110 separates safe, idempotent, and non-idempotent methods for exactly this reason.

Your client gave up at 5.0s. The model finished at 5.4s. You have just scheduled a duplicate.

Corrected model: a timeout is an unknown, not a failure. Treat it as "maybe happened".

Myth 2: "A 200 means the work happened once"

A 200 means this attempt succeeded.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.