Skip to main content

classify

Function classify 

Source
pub fn classify(
    declaration: QueueDeclaration,
    census: &PoolCensus,
) -> Option<QueueServiceReason>
Expand description

Classify one selection miss into the taxonomy.

Returns None when the caller must simply retry selection rather than report a state that is no longer true. That covers two cases: the address is genuinely served because a worker arrived between the two lock acquisitions, and the address’s compatible workers are all serving an opening probation, which clears on its own within seconds.

🔴 It does NOT cover a pool whose compatible workers have all LOST reachability. That does not clear on its own, so returning None there parks the dispatch indefinitely with nothing published about why — the silent stall this arm exists to prevent.

Ordering is deliberate: a structurally undeclared queue is reported as QueueServiceReason::NoQueueDeclaration even when unrelated workers sit in the pool, because that is the deeper fact and the only one that refuses unconditionally. QueueDeclaration::Unknown never manufactures a structural refusal — the same fail-open discipline worker registration applies when no catalog is reachable.

QueueServiceReason::Saturated is never produced here: it is not a selection miss. It is emitted by the delivery path (super::delivery::deliver_within_schedule_to_start) when a compatible worker is live and refuses intake past the schedule-to-start clock.