Knowledgebase

Timeouts and Their Consequences Print

  • 0

Not waiting forever.

WHY TIMEOUTS MATTER MORE THAN THEY SEEM

A call with no timeout can hold a connection, a thread and a transaction indefinitely.

WHAT THAT CAUSES

Resource exhaustion in your own system, caused by someone else's.

WHAT TO SET

A connection timeout A read timeout A total time limit

WHY SEPARATE

Connecting quickly then hanging is a common failure.

WHAT VALUES TO CHOOSE

Based on observed response times, not guesses.

HOW TO ESTABLISH THEM

Measure the distribution, and set above the high percentile.

WHY NOT THE AVERAGE

Most calls are fast, and the timeout is about the slow ones.

WHAT TO CONSIDER ABOUT NESTED CALLS

Each layer's timeout must be shorter than the layer above.

WHY

Otherwise the outer layer gives up while the inner still waits.

WHAT THAT PATTERN IS CALLED

A timeout budget.

WHAT TO DO ON TIMEOUT

Treat the outcome as unknown, not as failure.

WHY THAT DISTINCTION IS CRITICAL

The other side may have completed the work.

WHAT THAT MEANS FOR PAYMENTS

Never assume a timed-out payment did not happen.

WHAT TO DO INSTEAD

Query its status, or reconcile.

WHAT TO LOG

Timeouts separately from errors.

WHY

They indicate different problems and different responses.


Was this answer helpful?
Back

Are you happy with your experience? Leave us a review on Trustpilot.


Trustpilot