Operation Deadline and Cancellation Contract

Operation Deadline and Cancellation Contract A sequence diagram generated by Archify. client.operation(timeout=T) bind task + loop + epoch invoke first-party phase dispatch with min(phase, operation) join or create detached poll leader owned expiry → OperationTimeoutError external cancel → CancelledError Bind aggregate operation Run bounded phases Attribute termination Caller · owning asyncio task · Sequence participant Caller owning asyncio task Client API · public operation · Sequence participant Client API public operation Operation Context · deadline + ownership · Sequence participant Operation Context deadline + ownership Shared Poll · detached leader · Sequence participant Shared Poll detached leader Transport · RPC / HTTP · Sequence participant Transport RPC / HTTP Legend request return security async trace default message

Deadline Contract

  • • The aggregate budget spans retries, polling waiters, transfers, and follow-up phases
  • • Phase and nested scopes can shorten but never extend the earliest deadline

Ownership Contract

  • • The scope is task-, loop-, and epoch-owned; arbitrary child tasks do not inherit it
  • • External cancellation stays CancelledError; detached polling survives one waiter