Skip to main content

Module deadline

Module deadline 

Source
Expand description

Per-spawn wall-clock deadlines (#221).

A runaway agent otherwise runs until someone notices and kills it. A spawn may carry a timeout; prospero records the resulting deadline in the event log and enforces it from the poll loop.

The log is what makes the deadline survive a replica failover: a local timer dies with the replica that set it, while DeadlineSet is in the shared store and any replica that takes the agent over can read it back. Enforcement runs under the same lifecycle lease as the loop’s other emissions (#59), so exactly one replica acts on an expiry.

Functions§

deadline_from
The deadline a spawn’s timeout implies, as RFC-3339, or None when the spawn asked for no timeout.
deadline_in
The newest deadline in an agent’s stored history, if it ever had one.
expired
Which agents have passed their deadline and should be killed now.