[master] a8b56df Add a debug option to slow down acceptor threads so that we can stabilize test c00080.
Poul-Henning Kamp
phk at FreeBSD.org
Sat Feb 25 23:16:05 CET 2017
commit a8b56df31e7f4b5a711e08603fa6f0f577e3ca57
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date: Sat Feb 25 22:15:24 2017 +0000
Add a debug option to slow down acceptor threads so that we
can stabilize test c00080.
diff --git a/bin/varnishd/cache/cache_acceptor.c b/bin/varnishd/cache/cache_acceptor.c
index b570db2..2f28418 100644
--- a/bin/varnishd/cache/cache_acceptor.c
+++ b/bin/varnishd/cache/cache_acceptor.c
@@ -466,6 +466,8 @@ vca_accept_task(struct worker *wrk, void *arg)
TASK_QUEUE_VCA));
return;
}
+ if (!ps->pool->die && DO_DEBUG(DBG_SLOW_ACCEPTOR))
+ VTIM_sleep(2.0);
/*
* We were able to hand off, so release this threads VCL
diff --git a/bin/varnishtest/tests/c00080.vtc b/bin/varnishtest/tests/c00080.vtc
index 6a53959..b231b69 100644
--- a/bin/varnishtest/tests/c00080.vtc
+++ b/bin/varnishtest/tests/c00080.vtc
@@ -8,33 +8,19 @@ server s1 {
varnish v1 -vcl+backend {} -start
varnish v1 -cliok "param.set debug +drop_pools"
+varnish v1 -cliok "param.set debug +slow_acceptor"
varnish v1 -cliok "param.set thread_pools 1"
delay 2
-client c1 {
+client c1 -repeat 2 {
txreq
rxresp
} -run
-varnish v1 -vsc *poo*
-
delay 2
-client c1 {
- txreq
- rxresp
-} -run
-
-varnish v1 -vsc *poo*
-
-delay 2
-
-client c1 {
- txreq
- rxresp
-} -run
-
+varnish v1 -vsc *thr*
varnish v1 -vsc *poo*
varnish v1 -expect MAIN.pools == 1
diff --git a/include/tbl/debug_bits.h b/include/tbl/debug_bits.h
index ea6bf35..1db9db8 100644
--- a/include/tbl/debug_bits.h
+++ b/include/tbl/debug_bits.h
@@ -45,6 +45,7 @@ DEBUG_BIT(VTC_MODE, vtc_mode, "Varnishtest Mode")
DEBUG_BIT(WITNESS, witness, "Emit WITNESS lock records")
DEBUG_BIT(VSM_KEEP, vsm_keep, "Keep the VSM file on restart")
DEBUG_BIT(DROP_POOLS, drop_pools, "Drop thread pools (testing)")
+DEBUG_BIT(SLOW_ACCEPTOR, slow_acceptor, "Slow down Acceptor")
#undef DEBUG_BIT
/*lint -restore */
More information about the varnish-commit
mailing list