cloudflare / cloudflare/pingora

failure to bind listening socket not handled

Open
#667 2 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
Rust
Stars
27.4k
Forks
1.7k
Avg merge
6h 22m
Merged PRs (30d)
3

Description

## Describe the bug

A message is logged when pingora-proxy fails to bind its listener port, but there doesn't appear to be any way to handle the failure.

The server remains up and running, but doesn't accept requests or recover if the desired port is freed.

The error that is logged to the console, for reference:

```
Failed to build listeners: Error { etype: BindError, esource: Unset, retry: Decided(false), cause: Some(Os { code: 48, kind: AddrInUse, message: "Address already in use" }), context: Some(Owned("bind() failed, after retries, 127.0.0.1:8000 still in use")) }
```

## Pingora info

Please include the following information about your environment:

**Pingora version**: 0.5.0
**Rust version**: 1.88.0
**Operating system version**: macOS 15.5

## Steps to reproduce

Can be reproduced using the code here: [https://github.com/tmeumann/fakie](https://github.com/tmeumann/fakie)

Assuming port 8000 is already bound, running the code in the linked repo will with the following parameters will reproduce the issue:

```
cargo run --listen 127.0.0.1:8000 https://example.com
```

## Expected results

The process to exit, or the Pingora API to provide some other way to handle the failure.

## Observed results

The server hangs, unable to accept requests.

## Additional context

It's possible I'm missing something here. If so, please let me know!

I'm potentially open to working on a solution if desired.

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.