liveBook · Manning

Timeout mechanism

As explained in Microservices Patterns, Second Edition

A timeout mechanism limits how long an operation may wait for a response before treating the wait as a failure or exceptional condition.

A timeout limits how long a saga step waits for a participant’s response. It can help a system command meet its execution-time SLO, but a missing response does not prove that the step failed. section 9.2.3

Order creation and credit reservation

If Customer Service does not respond to reserveCredit() within the chosen interval, the Create Order Saga can treat the step as failed and reject the order. Because credit may already have been reserved, it must also send cancelReserveCredit() to preserve consistency. section 9.2.3

Use a timeout when bounded execution matters, and pair it with coordination that handles the possibility that the operation succeeded despite the missing response. Waiting indefinitely may let sagas complete eventually, but can miss the command’s SLO. section 9.2.3

How Microservices Patterns, Second Edition covers it

How deep it goes
Explains timeout consequences through an order workflow and consistency requirement, without specifying timeout implementation.
Examples
Uses a Create Order Saga waiting for Customer Service to answer reserveCredit().
What you can do after
Evaluate when bounded waits justify handling possible success through a cancellation request.
How it connects
Connects saga coordination, service-level objectives, and cancellation requests.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Microservices Patterns, Second Edition. The section links point to the parts of the book it draws on.