mirror of
https://github.com/cloudflare/pingora.git
synced 2024-09-20 02:31:35 +02:00
Allow Stale phase in cache_miss
There could be a race condition where a Stale request waiting on cache lock retries the cache lock and lookup, but enters cache_miss after finding the asset is no longer present.
This commit is contained in:
parent
e0ade326ed
commit
e5fda7c657
2 changed files with 3 additions and 2 deletions
2
.bleep
2
.bleep
|
@ -1 +1 @@
|
|||
0f6ff9925981892f544498c8b322cc66f55281c8
|
||||
e68f6024370efed50aebc8741171956acabf9c35
|
|
@ -493,7 +493,8 @@ impl HttpCache {
|
|||
match self.phase {
|
||||
// from CacheKey: set state to miss during cache lookup
|
||||
// from Bypass: response became cacheable, set state to miss to cache
|
||||
CachePhase::CacheKey | CachePhase::Bypass => {
|
||||
// from Stale: waited for cache lock, then retried and found asset was gone
|
||||
CachePhase::CacheKey | CachePhase::Bypass | CachePhase::Stale => {
|
||||
self.phase = CachePhase::Miss;
|
||||
self.inner_mut().traces.start_miss_span();
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue