[master] b301c17cb Lock updates of VSC counters for connection errors.

Poul-Henning Kamp phk at FreeBSD.org
Tue Apr 20 21:10:13 UTC 2021


commit b301c17cba2cc25b18a2307456bb140106de29ef
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date:   Tue Apr 20 20:42:31 2021 +0000

    Lock updates of VSC counters for connection errors.

diff --git a/bin/varnishd/cache/cache_backend.c b/bin/varnishd/cache/cache_backend.c
index fc774efff..6ba15ffd8 100644
--- a/bin/varnishd/cache/cache_backend.c
+++ b/bin/varnishd/cache/cache_backend.c
@@ -157,7 +157,9 @@ vbe_dir_getfd(VRT_CTX, struct worker *wrk, VCL_BACKEND dir, struct backend *bp,
 	FIND_TMO(connect_timeout, tmod, bo, bp);
 	pfd = VCP_Get(bp->conn_pool, tmod, wrk, force_fresh, &err);
 	if (pfd == NULL) {
+		Lck_Lock(bp->director->mtx);
 		VBE_Connect_Error(bp->vsc, err);
+		Lck_Unlock(bp->director->mtx);
 		VSLb(bo->vsl, SLT_FetchError,
 		     "backend %s: fail errno %d (%s)",
 		     VRT_BACKEND_string(dir), err, vstrerror(err));


More information about the varnish-commit mailing list