Skip to main content

is_trt_shape_rejected

Function is_trt_shape_rejected 

Source
pub(crate) fn is_trt_shape_rejected(err: &Error) -> bool
Expand description

Returns true when err (or anything in its source chain) is a TrtJitRejection.

The worker uses this to (a) skip the inference circuit breaker for guard refusals - a refusal means the worker is healthy and deliberately protecting itself, not a failing GPU - and (b) the HTTP layer uses the same chain walk to map the refusal to 503 rather than 500. Walking the chain (not just the top error) lets callers wrap the rejection with anyhow::Error::context for additional log context without breaking detection.