One of the reliability properties of Pingora is that a panic occurring during the processing of one request does not affect any other request in flight, nor does it bring down the server. Pingora runs request handlers inside the Tokio asynchronous runtime, which catches panics at the task boundary and converts them into task termination rather than process termination. The result is that a rogue panic is isolated to the single request that triggered it: the socket acquired for that request is dropped (closed), the client receives a connection reset, and every other request continues unaffected.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/cloudflare/pingora/llms.txt
Use this file to discover all available pages before exploring further.
How Panic Isolation Works
When a panic unwinds through a request-handling task, Tokio captures it and terminates that task. Pingora does not attempt to recover state from the panicking task — it simply discards it. Any resources held exclusively by that task (TCP sockets, acquired upstream connections) are released through normal Rust drop semantics as the task unwinds. From the client’s perspective, the connection is closed abruptly. From the server’s perspective, the event is invisible to other tasks: they continue running, accepting new connections, and processing their own requests without interruption.Monitoring Panics with Sentry
Although panics are not fatal, they represent unexpected logic errors that should be investigated. Pingora has built-in Sentry integration to capture and report panics automatically. To enable it, pass aClientOptions value to set_sentry_config before starting the server:
Cargo.toml:
Prefer Results Over Panics
Even though Pingora’s runtime provides a safety net for request-level panics, panics should be reserved for detecting truly unexpected programming errors — invariants that cannot be violated in a correct program. For all anticipated failure modes (network timeouts, upstream errors, malformed input), useResult and the ? operator so that errors propagate cleanly through Pingora’s error-handling pipeline, get logged with full request context, and can be observed via metrics.
