Skip to main content

Module lifetime_clock

Module lifetime_clock 

Source
Expand description

Ephemeral lifetime clock — TTL expiry + teardown-policy decisions.

The reconciler consults this module at each phase tick to decide whether a Process should auto-terminate:

  • TTL is measured from metadata.creation_timestamp (the most deterministic anchor — phaseSince resets per phase).
  • Teardown policy applies on Attested or Failed per EphemeralLifetime.teardown_policy.

Returning AutoTerminate::Now { reason } tells the caller to transition the Process to Exiting. The phase machine handles the SIGTERM path from there (children drained, finalizer guards owned resources).

Structs§

UnknownAutoTerminateKind
UnknownTerminateReasonKind

Enums§

AutoTerminate
Decision the phase machine acts on.
AutoTerminateKind
The closed set of AutoTerminate kinds — the discriminator view, payload-stripped, that sibling closed-set enums in this crate carry (see TerminateReasonKind, crate::matrix::SelectStrategyKind, crate::lifetime::LifetimeKind).
TerminateReason
Why the ephemeral lifetime clock fired.
TerminateReasonKind
The closed set of TerminateReason kinds — the discriminator view, payload-stripped, that sibling closed-set enums in this crate carry (see ProcessPhase, TeardownPolicy).

Functions§

evaluate
Inspect a Process at the given current phase and return whether the ephemeral lifetime clock fires now.
requeue_with_ttl
Sleep budget the controller should requeue with for a Process whose evaluate() returned Skip — picks the smaller of HEARTBEAT and TTL-remaining so we don’t oversleep past expiry.