Enum PreemptionReason
pub enum PreemptionReason {
PriorityPreemption,
QuotaRebalance,
BurstCreditExhausted,
BudgetExhausted,
CostCapEviction,
OperatorDrain,
OperatorMigProfileChange,
MaintenanceWindow,
PolicyViolationRecovery,
}Expand description
Typed reasons for which an admission was rejected or an existing lease was preempted. Phase 218 enumerates these up front so the admission, audit, and DRA layers all agree on the vocabulary.
The reason MUST be present on every preemption emit. There is no
Other(String) variant on purpose: a generic kill path is exactly
what the typed-lifecycle rule rejects.
New reasons require a design-doc update plus a typed regression test that asserts the reason fires in the case it names. Adding a reason is a vocabulary change, not a runtime config knob.
Variants§
PriorityPreemption
Higher-priority admitted work is allowed to reclaim resources from lower-priority preemptible work.
QuotaRebalance
Tenant or project usage must be moved back inside its configured
fair-share/quota envelope. Distinct from BurstCreditExhausted:
a QuotaRebalance typically admitted a different tenant.
BurstCreditExhausted
The tenant’s token-bucket burst credit reached zero while the request required burst capacity beyond hard quota. No other tenant was admitted; the workload was rejected for exceeding its own configured burst envelope.
BudgetExhausted
Tenant budget or spend policy is exhausted and the work is configured as preemptible on budget exhaustion.
CostCapEviction
Phase 216 economics policy requires eviction because a hard cost cap can no longer be satisfied.
OperatorDrain
An operator initiated node/cell drain.
OperatorMigProfileChange
An operator initiated GPU MIG profile recompose. Shared with Phase 221 dynamic MIG profile recompose so audit logs distinguish operator-driven GPU repartitioning from ordinary priority preemption.
MaintenanceWindow
A scheduled maintenance policy requires the resource to be cleared.
PolicyViolationRecovery
The system detected a previously admitted lease no longer
satisfies a mandatory policy and must fail closed or recover.
Emit MUST carry a typed policy_id naming the violated policy
— emit without policy_id is a typed error, not a string default.
Implementations§
§impl PreemptionReason
impl PreemptionReason
pub fn as_str(self) -> &'static str
pub fn as_str(self) -> &'static str
Stable wire / log identifier. Used by audit emit, DRA failure types, and Phase 219 docs lint. MUST be stable across minor versions: external collectors group on this string.
pub fn human_summary(self) -> &'static str
pub fn human_summary(self) -> &'static str
Tooltip-grade operator-readable phrase for this preemption
reason. Mirrors the [RejectionReason::human_summary] shape
so dashboard / CLI surfaces can render typed preemption
reasons without re-deriving the prose.
as_str() remains the wire-format-grade snake_case label
SIEM rules and audit collectors group on; human_summary()
is the rendering helper. They are NOT interchangeable.
The string is intentionally short (one line, no terminal
punctuation) so a renderer can compose it inline. The
runbook at docs/runbooks/preemption-explanations.md is
the long-form operator-action prose; this helper is the
tooltip-grade sibling.
Slice 73 lands the helper without dashboard wiring — there is no preemption panel yet. When that surface lands it can read this method directly.
Trait Implementations§
§impl Clone for PreemptionReason
impl Clone for PreemptionReason
§fn clone(&self) -> PreemptionReason
fn clone(&self) -> PreemptionReason
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more