Skip to main content

validate_incoming_session_pix_config

Function validate_incoming_session_pix_config 

Source
fn validate_incoming_session_pix_config(
    cfg: &IncomingSessionPixConfig,
) -> Result<(), ValidationError>
Expand description

Rejects an IncomingSessionPixConfig that cannot work.

Three independent failures, all of which would otherwise only show up at runtime:

quota_range is operator-settable, and an empty (inverted) range silently makes check_pix_params reject every offered PIX parameter set, which surfaces only as UnacceptablePixParams errors at Session establishment time.

max_recovery_time has to leave a whole cycle at the widest dimensions this Exit will accept time to complete, or it closes honest Sessions partway through one. With fill enabled that is judged at fill.max_rate, counted up to MAX_ASSUMED_SESSION_PACKET_RATE; without it, at that rate itself, so only a deadline no Session could meet is refused. The check is possible at all only because the quota counts the surplus: quota_range.end() prices every share a cycle emits, so the packet count follows by division with nothing left to guess.

And max_live_cycle_bytes has to admit at least one Session at those same widest dimensions, or the Exit advertises a quota_range whose top it will always refuse for want of budget — again as a Start error the operator cannot attribute. Deliberately one Session and not maximum_managed_sessions of them: this budget exists precisely because that product is a number no node holds, so checking it here would only ever reject the shipping defaults.