cloudflare / cloudflare/pingora

Result from a DNS lookup or similar operation causes panic

Open
#570 2 comments 5 reactions 1 assignee Assigned to @andrewhavck View on GitHub
bug
Dominant language
Rust
Stars
27.4k
Forks
1.7k
Avg merge
6h 22m
Merged PRs (30d)
3

Description

## Describe the bug
The panic is happening because the code in Pingora (specifically in peer.rs line 453) calls unwrap() on a result from a DNS lookup or similar operation. Ideally, you’d want to handle such errors gracefully rather than panicking.

## Pingora info

Please include the following information about your environment:

**Pingora version**: release number of commit hash
0.4.0
**Rust version**: i.e. `cargo --version`
cargo 1.85.1
rustc 1.85.1 (4eb161250 2025-03-15) (Homebrew)
**Operating system version**: e.g. Ubuntu 22.04, Debian 12.4
Pingora running on MacOS 15.3.2 (24D81), M4Max
## Steps to reproduce

Please provide step-by-step instructions to reproduce the issue. Include any relevant code
snippets.

## Expected results
Graceful handling of error

What were you expecting to happen?

## Observed results
thread 'Pingora HTTP Proxy Service' panicked at ./cargo/registry/src/index.crates.io-1949cf8c6b5b557f/pingora-core-0.4.0/src/upstreams/peer.rs:453:56:
called `Result::unwrap()` on an `Err` value: Custom { kind: Uncategorized, error: "failed to lookup address information: nodename nor servname provided, or not known" }

What actually happened?
Under heavy load (pingora-proxy), DNS resolver for a GCP CloudRun endpoint didn't respond causing Pingora to panic.

## Additional context

What other information would you like to provide? e.g. screenshots, how you're working around the
issue, or other clues you think could be helpful to identify the root cause.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.