cloudflare / cloudflare/pingora
Make MAX_RETRIES configurable
- Dominant language
- Rust
- Stars
- 27.4k
- Forks
- 1.7k
- Avg merge
- 6h 22m
- Merged PRs (30d)
- 3
Description
I noticed that the maximum number of retries is set to 16.
https://github.com/cloudflare/pingora/blob/bdb13a7e40b19280d703ad1f64abc29ee5baf480/pingora-proxy/src/lib.rs#L68
With my proxy a user may be sent to an application that needs to perform a cold start. That time may be a few seconds or longer.
I have set the retry to wait 100ms before retrying.
```rs
fn fail_to_connect(
&self,
_session: &mut Session,
_peer: &HttpPeer,
_ctx: &mut Self::CTX,
mut e: Box,
) -> Box {
e.set_retry(true);
std::thread::sleep(std::time::Duration::from_millis(100));
e
}
```
Ideally, I'd like to be able to configure it to poll every `x` ms for a maximum `Duration` before finally giving up instead of a fixed number of retries.
Contributor guide
Assessment
This issue has not been assessed yet.