From d604088199afff4b40ac7ca94012adc103e3350b Mon Sep 17 00:00:00 2001 From: Walid Boudebouda Date: Thu, 29 Feb 2024 10:24:48 +0100 Subject: [PATCH] cache_backend: Re-check that BE is still busy after wakeup This makes sure that we won't abort a backend connection attempt if the backend can take it. It covers for any potential missing connwait_signal call. --- bin/varnishd/cache/cache_backend.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/varnishd/cache/cache_backend.c b/bin/varnishd/cache/cache_backend.c index a3b6eea5aa..bf42d6e3f3 100644 --- a/bin/varnishd/cache/cache_backend.c +++ b/bin/varnishd/cache/cache_backend.c @@ -224,7 +224,7 @@ vbe_dir_getfd(VRT_CTX, struct worker *wrk, VCL_BACKEND dir, struct backend *bp, wait_end); } while (err == EINTR); bp->cw_count--; - if (err != 0) { + if (err != 0 && BE_BUSY(bp)) { VTAILQ_REMOVE(&bp->cw_head, cw, cw_list); VSC_C_main->backend_wait_fail++; cw->cw_state = CW_BE_BUSY;