Skip to content

Commit

Permalink
cache_backend: Re-check that BE is still busy after wakeup
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
walid-git committed Feb 29, 2024
1 parent 9986084 commit d604088
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion bin/varnishd/cache/cache_backend.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit d604088

Please sign in to comment.