mirror of
https://github.com/cloudflare/pingora.git
synced 2024-09-20 02:31:35 +02:00
disable caching during error handling
This has the effect of reducing a warning log since we are not leaving the lock dangling for the next reader.
This commit is contained in:
parent
4446912080
commit
5e3e774a8d
3 changed files with 3 additions and 4 deletions
2
.bleep
2
.bleep
|
@ -1 +1 @@
|
|||
b0ee94e1ce384cb2d23a40bf6c7a4b7e32541412
|
||||
30c624970d46b07efd110fcfb8dd0b6f9a099e2b
|
|
@ -607,6 +607,8 @@ impl<SV> HttpProxy<SV> {
|
|||
};
|
||||
|
||||
if let Some(e) = final_error.as_ref() {
|
||||
// If we have errored and are still holding a cache lock, release it.
|
||||
session.cache.disable(NoCacheReason::InternalError);
|
||||
let status = self.inner.fail_to_proxy(&mut session, e, &mut ctx).await;
|
||||
|
||||
// final error will have > 0 status unless downstream connection is dead
|
||||
|
|
|
@ -1077,9 +1077,6 @@ mod test_cache {
|
|||
init();
|
||||
let url = "http://127.0.0.1:6148/sleep/test_cache_lock_network_error.txt";
|
||||
|
||||
// FIXME: Dangling lock happens in this test because the first request aborted without
|
||||
// properly release the lock. This is a bug
|
||||
|
||||
let task1 = tokio::spawn(async move {
|
||||
let res = reqwest::Client::new()
|
||||
.get(url)
|
||||
|
|
Loading…
Reference in a new issue