Skip to content
Sequence & interaction templates

Teaching Case — Two Services Waiting on Each Other

Four ordinary arrows and two ordinary activation bars. Inventory calls pricing while pricing is mid-call to inventory, and neither call is ever answered — so each is waiting for a reply that cannot arrive until it replies first. The picture is a deadlock and it is indistinguishable from a working handshake. The engine also refuses the false positive next door: a callback that IS answered — one service calling back into another mid-call and getting a reply — is ordinary and this check says nothing about it.

Template previewSequence & interaction
Reservation — mutual wait3 messages · deepest 3 openreserve(sku, 2)quote(sku, 2)stockOnHand(sku)CartInventoryPricing1 statement in this interaction contradicts another, and 1 more is probably not what was meant —over 3 lifelines and 3 messages.ERROR`Inventory` waits on `Pricing` waits on `Inventory` — and that closes the loop. Every call in this chain is stilloutstanding when the document ends, so each of them is waiting for an answer that cannot arrive until itanswers first. It draws as ordinary arrows and ordinary activation bars; the picture is a deadlock and looksexactly like a working handshake. A callback that IS answered is not this: `A` calling `B` while `B` is mid-call isordinary, and this engine says nothing about it.WARN1 call is never answered: `Cart` → `Inventory` on line 7. A synchronous caller waits, so as drawn that lifeline isblocked when the interaction ends. A diagram deliberately drawn as an excerpt can say so with `async` for amessage nobody waits on, or `ref` for an interaction shown elsewhere.INFO3 lifelines, 3 messages. 3 synchronous calls, 0 answered; the deepest point of the interaction has 3 calls open atonce. Every message states whether it is a call, a reply or a fire-and-forget, so the stack above was simulatedrather than guessed at.OK15 of the 17 checks ran over every instance of their subject and found nothing: misdirected-reply, orphan-reply,conditional-reply, after-destroy, before-create, double-create, double-destroy, par-interference, guard-overlap,guard-incomplete, activation-claim, unused-participant, undeclared-lifeline, duplicate-id, fragment-unclosed.

Make it your own.

sequence "Reservation — mutual wait"

participant Cart      "Cart"
participant Inventory "Inventory"
participant Pricing   "Pricing"

Cart      -> Inventory : reserve(sku, 2)
Inventory -> Pricing   : quote(sku, 2)
Pricing   -> Inventory : stockOnHand(sku)