PreemptionReason

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

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

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

§

fn clone(&self) -> PreemptionReason

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
§

impl Debug for PreemptionReason

§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
§

impl<'de> Deserialize<'de> for PreemptionReason

§

fn deserialize<__D>( __deserializer: __D, ) -> Result<PreemptionReason, <__D as Deserializer<'de>>::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
§

impl Display for PreemptionReason

§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
§

impl Hash for PreemptionReason

§

fn hash<__H>(&self, state: &mut __H)
where __H: Hasher,

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
§

impl PartialEq for PreemptionReason

§

fn eq(&self, other: &PreemptionReason) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
§

impl Serialize for PreemptionReason

§

fn serialize<__S>( &self, __serializer: __S, ) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
§

impl Copy for PreemptionReason

§

impl Eq for PreemptionReason

§

impl StructuralPartialEq for PreemptionReason

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,