SkyRaun / Studies / Timeout ambiguity

Your HTTP client timed out. Did the request actually fail?

A client gives up at two seconds. The server committed at 1.87. Both behaved exactly as designed, and now two systems disagree about whether a payment happened.

http placeholder copy 14 July 2026 · 9 min read

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.

Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

What the client observed

Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo.

0.000s  client  POST /payments   amount=4200
0.014s  server  handler entered
1.870s  server  committed        charge_01H8Z
2.000s  client  read timeout — no response bytes
2.001s  client  reported to caller: FAILED
2.410s  server  200 OK written to a closed socket
Placeholder caption. One timeline, two incompatible beliefs about the same event.

Nemo enim ipsam voluptatem quia voluptas sit aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos qui ratione voluptatem sequi nesciunt.

the point

A timeout tells you one thing only: no response arrived in time. It says nothing whatsoever about whether the operation ran.

Why the obvious fix makes it worse

Neque porro quisquam est, qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit, sed quia non numquam eius modi tempora incidunt ut labore et dolore magnam aliquam quaerat voluptatem.

  • Ut enim ad minima veniam, quis nostrum exercitationem ullam corporis
  • Nisi ut aliquid ex ea commodi consequatur, quis autem vel eum
  • Iure reprehenderit qui in ea voluptate velit esse quam nihil molestiae

Reproducing it locally

At vero eos et accusamus et iusto odio dignissimos ducimus qui blanditiis praesentium voluptatum deleniti atque corrupti quos dolores et quas molestias excepturi sint.

payments_server.pyplaceholder
def post_payment(request):
    charge = ledger.commit(request.body)   # side effect happens here
    time.sleep(SLOW_RESPONSE)              # the response is what's late
    return Response(200, {"charge": charge.id})

The money moved. Your logs, your client and your customer all believe it did not.

Where idempotency actually belongs

Et harum quidem rerum facilis est et expedita distinctio. Nam libero tempore, cum soluta nobis est eligendi optio cumque nihil impedit quo minus id quod maxime placeat facere possimus.

Temporibus autem quibusdam et aut officiis debitis aut rerum necessitatibus saepe eveniet ut et voluptates repudiandae sint et molestiae non recusandae.

What to take away

Itaque earum rerum hic tenetur a sapiente delectus, ut aut reiciendis voluptatibus maiores alias consequatur aut perferendis doloribus asperiores repellat.

Placeholder endnote — this is where the reproduction steps, the environment details and any corrections would live, so a reader can run the experiment themselves and disagree with the conclusion.

the lab behind this study

Reading it is not the same as causing it.

Module 04 hands you the server, the impatient client and the ledger. You make the timeout happen, retry it, watch the duplicate charge land, then move the identity decision to the side that owns the state — and prove it holds.