[master] 57e660bd4 vbe: Unconditionally clear the backend queue

Dridi Boukelmoune dridi.boukelmoune at gmail.com
Mon Sep 16 15:02:05 UTC 2024


commit 57e660bd46d141ffcf064f6162daac6405fbb515
Author: Dridi Boukelmoune <dridi.boukelmoune at gmail.com>
Date:   Mon Sep 16 16:58:00 2024 +0200

    vbe: Unconditionally clear the backend queue
    
    Refs #4134

diff --git a/bin/varnishd/cache/cache_backend.c b/bin/varnishd/cache/cache_backend.c
index 4a0e0a424..c7c136bba 100644
--- a/bin/varnishd/cache/cache_backend.c
+++ b/bin/varnishd/cache/cache_backend.c
@@ -140,8 +140,9 @@ VBE_Connect_Error(struct VSC_vbe *vsc, int err)
 /*--------------------------------------------------------------------*/
 
 int
-VBE_is_ah_auto (const struct backend *bp)
+VBE_is_ah_auto(const struct backend *bp)
 {
+
 	CHECK_OBJ_NOTNULL(bp, BACKEND_MAGIC);
 	return (bp->director->vdir->admin_health == VDI_AH_AUTO);
 }
@@ -150,17 +151,9 @@ void
 VBE_connwait_signal_all(const struct backend *bp)
 {
 	struct connwait *cw;
-	unsigned wait_limit;
-	vtim_dur wait_tmod;
 
 	CHECK_OBJ_NOTNULL(bp, BACKEND_MAGIC);
 
-	FIND_BE_PARAM(backend_wait_limit, wait_limit, bp);
-	FIND_BE_TMO(backend_wait_timeout, wait_tmod, bp);
-
-	if (wait_limit == 0 || wait_tmod <= 0)
-		return;
-
 	Lck_Lock(bp->director->mtx);
 	VTAILQ_FOREACH(cw, &bp->cw_head, cw_list) {
 		CHECK_OBJ(cw, CONNWAIT_MAGIC);
diff --git a/bin/varnishtest/tests/v00074.vtc b/bin/varnishtest/tests/v00074.vtc
index 72104f01d..254718678 100644
--- a/bin/varnishtest/tests/v00074.vtc
+++ b/bin/varnishtest/tests/v00074.vtc
@@ -190,8 +190,6 @@ varnish v1 -vcl {
 		.host = "${v0_addr}";
 		.port = "${v0_port}";
 		.max_connections = 1;
-		.wait_timeout = 1h;
-		.wait_limit = 10;
 	}
 
 	probe default {
@@ -205,7 +203,10 @@ varnish v1 -vcl {
 		return(pass);
 	}
 } -start
+
 varnish v1 -cliok "backend.set_health be healthy"
+varnish v1 -cliok "param.set backend_wait_timeout 1h"
+varnish v1 -cliok "param.set backend_wait_limit 10"
 
 client c9 {
 	txreq
@@ -245,8 +246,13 @@ client c12 {
 
 # make sure c10-12 are already in the queue
 barrier b6 sync
+
+varnish v1 -cliok "param.reset backend_wait_timeout"
+varnish v1 -cliok "param.reset backend_wait_limit"
+
 # Going back to probe (auto) that is sick should
-# wake up reqs in the wait queue
+# wake up reqs in the wait queue, even if queuing
+# is currently disabled.
 varnish v1 -cliok "backend.set_health be auto"
 
 client c9 -wait


More information about the varnish-commit mailing list