aboutsummaryrefslogtreecommitdiffhomepage
path: root/pingora-proxy/src/proxy_h2.rs
diff options
context:
space:
mode:
authorEdward Wang <[email protected]>2024-11-11 18:09:55 -0800
committerMatthew Gumport <[email protected]>2024-11-22 14:52:01 -0800
commit725329fa717b878615e2d207165e0573bcd09ee5 (patch)
tree17ae9b6fb9b00f2ba1304b95f48cd5ec4dbe2c83 /pingora-proxy/src/proxy_h2.rs
parenta03a03d444a2bda2618d8e5724948cec7603c5f8 (diff)
downloadpingora-bleeper-mgumport-89319e9383d6f99066dfeace750a553d45e1c167.tar.gz
pingora-bleeper-mgumport-89319e9383d6f99066dfeace750a553d45e1c167.zip
Release cache lock after proxy upstream filter, serve stalebleeper-mgumport-89319e9383d6f99066dfeace750a553d45e1c167
The cache locks may be held after serving stale, proxy upstream filter, or revalidate uncacheable resulting in dangling cache locks. Also only disable cache on final error if cache was not already disabled, and add DeclinedToUpstream / UpstreamError no cache reasons.
Diffstat (limited to 'pingora-proxy/src/proxy_h2.rs')
-rw-r--r--pingora-proxy/src/proxy_h2.rs1
1 files changed, 1 insertions, 0 deletions
diff --git a/pingora-proxy/src/proxy_h2.rs b/pingora-proxy/src/proxy_h2.rs
index ba832b2..a27c559 100644
--- a/pingora-proxy/src/proxy_h2.rs
+++ b/pingora-proxy/src/proxy_h2.rs
@@ -409,6 +409,7 @@ impl<SV> HttpProxy<SV> {
.cache_http_task(session, &task, ctx, serve_from_cache)
.await
{
+ session.cache.disable(NoCacheReason::StorageError);
if serve_from_cache.is_miss_body() {
// if the response stream cache body during miss but write fails, it has to
// give up the entire request