[master] 025f1a61f fetch: Log bgfetch_no_thread event

Dridi Boukelmoune dridi.boukelmoune at gmail.com
Fri Mar 15 10:05:05 UTC 2024


commit 025f1a61f10187f3a4ce9723253d49e6baf1ac06
Author: AlveElde <alve_elde at hotmail.com>
Date:   Mon Mar 11 18:30:48 2024 +0100

    fetch: Log bgfetch_no_thread event

diff --git a/bin/varnishd/cache/cache_fetch.c b/bin/varnishd/cache/cache_fetch.c
index f37183582..0f86d0305 100644
--- a/bin/varnishd/cache/cache_fetch.c
+++ b/bin/varnishd/cache/cache_fetch.c
@@ -1222,6 +1222,8 @@ VBF_Fetch(struct worker *wrk, struct req *req, struct objcore *oc,
 
 	if (Pool_Task(wrk->pool, bo->fetch_task, prio)) {
 		wrk->stats->bgfetch_no_thread++;
+		VSLb(bo->vsl, SLT_FetchError,
+		    "No thread available for bgfetch");
 		(void)vbf_stp_fail(req->wrk, bo);
 		if (bo->stale_oc != NULL)
 			(void)HSH_DerefObjCore(wrk, &bo->stale_oc, 0);
diff --git a/bin/varnishtest/tests/c00120.vtc b/bin/varnishtest/tests/c00120.vtc
index b340a48a9..ff9e41a1c 100644
--- a/bin/varnishtest/tests/c00120.vtc
+++ b/bin/varnishtest/tests/c00120.vtc
@@ -15,6 +15,10 @@ varnish v1 -vcl+backend {
 	}
 } -start
 
+logexpect l1 -v v1 {
+	expect * * FetchError "No thread available for bgfetch"
+} -start
+
 client c1 {
 	txreq
 	rxresp
@@ -29,4 +33,6 @@ client c1 {
 	expect resp.status == 200
 } -start
 
+logexpect l1 -wait
+
 varnish v1 -expect MAIN.bgfetch_no_thread == 1


More information about the varnish-commit mailing list