diff options
author | taikulawo <[email protected]> | 2024-11-23 15:26:57 +0800 |
---|---|---|
committer | Viacheslav Biriukov <[email protected]> | 2024-12-10 18:40:50 +0000 |
commit | 98bdb521cd43bf5dcc3455b2138293c642a84850 (patch) | |
tree | d6a6e343a1fa3af39f1cc364e1026acf5ee7197c /pingora-proxy/src | |
parent | 19ee3f9490a34175fb5c85ce9d6602b711d07643 (diff) | |
download | pingora-98bdb521cd43bf5dcc3455b2138293c642a84850.tar.gz pingora-98bdb521cd43bf5dcc3455b2138293c642a84850.zip |
fix deadloop if proxy_handle_upstream exit early than proxy_handle_downstream
Includes-commit: 87a0483e19cd79907f6a9851eecaac5d0a1bf4b1
Includes-commit: 1978a261816afbe5bf1cf56977dbc67e2d6cba1a
Includes-commit: f9730f6c71dc8a3ecf57e8e1a512462bbb6b7ea4
Includes-commit: 141996d93c6b088edc81a70bf062ed41154c8c74
Includes-commit: b8415685cb192e0d11f4cfb751e01eb26b8a5e5f
Includes-commit: 67283ad69f6ea04e219ac827bb9cf7cc4808da06
Includes-commit: d644ecc4186ccbf65442defff4fa34c2307d6a0a
Replicated-from: https://github.com/cloudflare/pingora/pull/480
Co-authored-by: Viacheslav Biriukov <[email protected]>
Diffstat (limited to 'pingora-proxy/src')
-rw-r--r-- | pingora-proxy/src/proxy_h1.rs | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/pingora-proxy/src/proxy_h1.rs b/pingora-proxy/src/proxy_h1.rs index 544a74e..e13d4c1 100644 --- a/pingora-proxy/src/proxy_h1.rs +++ b/pingora-proxy/src/proxy_h1.rs @@ -311,7 +311,9 @@ impl<SV> HttpProxy<SV> { }, _ = tx.reserve(), if downstream_state.is_reading() && send_permit.is_err() => { - debug!("waiting for permit {send_permit:?}"); + // If tx is closed, downstream already finish its job. + downstream_state.maybe_finished(tx.is_closed()); + debug!("waiting for permit {send_permit:?}, downstream closed {}", tx.is_closed()); /* No permit, wait on more capacity to avoid starving. * Otherwise this select only blocks on rx, which might send no data * before the entire body is uploaded. |