Skip to content

failure to bind listening socket not handled #667

@tmeumann

Description

@tmeumann

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

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions