diff options
author | taikulawo <[email protected]> | 2024-11-23 15:26:57 +0800 |
---|---|---|
committer | Yuchen Wu <[email protected]> | 2024-12-20 13:39:24 -0800 |
commit | bb111aaa92b3753e650957df3a68f56b0cffc65d (patch) | |
tree | d6a6e343a1fa3af39f1cc364e1026acf5ee7197c /pingora-proxy/src/proxy_h1.rs | |
parent | 343fc989a925b941d3f2f8e80a472fc129fcaa6c (diff) | |
download | pingora-bb111aaa92b3753e650957df3a68f56b0cffc65d.tar.gz pingora-bb111aaa92b3753e650957df3a68f56b0cffc65d.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/proxy_h1.rs')
-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. |