diff options
author | Yuchen Wu <[email protected]> | 2024-03-29 15:42:20 -0700 |
---|---|---|
committer | Andrew Hauck <[email protected]> | 2024-04-05 11:46:20 -0700 |
commit | dfcd3d1d9f493b830e97757ba8d43c07ee81c030 (patch) | |
tree | 0cfa357cd4257b0ea2b7c2d116c937426190b1cd /docs/user_guide | |
parent | 3c5d99c3f49a8d40a0fc16895b148dea9ea18e8d (diff) | |
download | pingora-dfcd3d1d9f493b830e97757ba8d43c07ee81c030.tar.gz pingora-dfcd3d1d9f493b830e97757ba8d43c07ee81c030.zip |
Fix typos and grammar issues in docs
And other things.
Co-authored-by: DimanNe <[email protected]>
Co-authored-by: Xiaobo Liu <[email protected]>
Co-authored-by: houseme <[email protected]>
Co-authored-by: lilo <[email protected]>
Co-authored-by: Yang He <[email protected]>
Diffstat (limited to 'docs/user_guide')
-rw-r--r-- | docs/user_guide/failover.md | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/docs/user_guide/failover.md b/docs/user_guide/failover.md index 5783256..d03ee45 100644 --- a/docs/user_guide/failover.md +++ b/docs/user_guide/failover.md @@ -14,10 +14,10 @@ Otherwise, once the response header is already sent downstream, there is nothing In order to implement retry or failover, `fail_to_connect()` / `error_while_proxy()` needs to mark the error as "retry-able." For failover, `fail_to_connect() / error_while_proxy()` also needs to update the `CTX` to tell `upstream_peer()` not to use the same `Peer` again. ### Safety -In general, idempotent HTTP requests, e.g., `GET`, are safe to retry. Other requests, e.g., `POST`, are not safe to retry if the requests have already been sent. When `fail_to_connect()` is called, pingora-proxy guarantees that nothing was sent upstream. Users are not recommended to retry an non-idempotent request after `error_while_proxy()` unless they know the upstream server enough to know whether it is safe. +In general, idempotent HTTP requests, e.g., `GET`, are safe to retry. Other requests, e.g., `POST`, are not safe to retry if the requests have already been sent. When `fail_to_connect()` is called, pingora-proxy guarantees that nothing was sent upstream. Users are not recommended to retry a non-idempotent request after `error_while_proxy()` unless they know the upstream server enough to know whether it is safe. ### Example -In the following example we set a `tries` variable on the `CTX` to track how many connection attempts we've made. When setting our peer in `upstream_peer` we check if `tries` is less than one and connect to 192.0.2.1. On connect failure we increment `tries` in `fail_to_connect` and set `e.set_retry(true)` which tells Pingora this a retryable error. On retry we enter `upstream_peer` again and this time connect to 1.1.1.1. If we're unable to connect to 1.1.1.1 we return a 502 since we only set `e.set_retry(true)` in `fail_to_connect` when `tries` is zero. +In the following example we set a `tries` variable on the `CTX` to track how many connection attempts we've made. When setting our peer in `upstream_peer` we check if `tries` is less than one and connect to 192.0.2.1. On connect failure we increment `tries` in `fail_to_connect` and set `e.set_retry(true)` which tells Pingora this is a retryable error. On retry, we enter `upstream_peer` again and this time connect to 1.1.1.1. If we're unable to connect to 1.1.1.1 we return a 502 since we only set `e.set_retry(true)` in `fail_to_connect` when `tries` is zero. ```Rust pub struct MyProxy(); |