aboutsummaryrefslogtreecommitdiffhomepage
path: root/pingora-cache/src/predictor.rs
diff options
context:
space:
mode:
authorEdward Wang <[email protected]>2024-11-11 18:09:55 -0800
committerEdward Wang <[email protected]>2024-11-22 16:03:16 -0800
commite309436319ed5cbc3aaf53221070a1fd070b8bcf (patch)
tree17ae9b6fb9b00f2ba1304b95f48cd5ec4dbe2c83 /pingora-cache/src/predictor.rs
parent1756948df77d257bddf7ab798cc3fddf348a91c8 (diff)
downloadpingora-e309436319ed5cbc3aaf53221070a1fd070b8bcf.tar.gz
pingora-e309436319ed5cbc3aaf53221070a1fd070b8bcf.zip
Release cache lock after proxy upstream filter, serve stale
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-cache/src/predictor.rs')
-rw-r--r--pingora-cache/src/predictor.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/pingora-cache/src/predictor.rs b/pingora-cache/src/predictor.rs
index df8f374..d131c20 100644
--- a/pingora-cache/src/predictor.rs
+++ b/pingora-cache/src/predictor.rs
@@ -120,7 +120,7 @@ where
// CacheLockGiveUp: the writer will set OriginNotCache (if applicable)
// readers don't need to do it
NeverEnabled | StorageError | InternalError | Deferred | CacheLockGiveUp
- | CacheLockTimeout => {
+ | CacheLockTimeout | DeclinedToUpstream | UpstreamError => {
return None;
}
// Skip certain NoCacheReason::Custom according to user