[master] bcba96492 Stabilize s10
Dridi Boukelmoune
dridi.boukelmoune at gmail.com
Wed Jan 8 15:34:06 UTC 2020
commit bcba964921106fb2267913208141e3b94c65d766
Author: Dridi Boukelmoune <dridi.boukelmoune at gmail.com>
Date: Wed Jan 8 16:18:22 2020 +0100
Stabilize s10
Contrary to previous attempts this one takes a different route that
is much more reliable and faster.
First, it sets things up so that we can predicatbly lock varnish when
it's trying to send the first (and only) part of the body. Instead of
assuming a delay that is sometimes not enough under load, we wait for
the timeout to show up in the log.
We can't put the barrier in l1 or l2 because logexpect spec evaluation
is eager, in order to cope with the VSL API.
Because we bypass the cache, we can afford letting c1 bail out before
completing the transaction, which is necessary because otherwise the
second c1 run would take forever on FreeBSD that takes our request to
limit the send buffer to 128 octets very seriously (on Linux we get
around 4k).
Because we use barriers, the send and receive buffers were bumped to
256 to ensure c1 doesn't fail (on FreeBSD) before it reaches barrier
statements.
diff --git a/bin/varnishtest/tests/s00010.vtc b/bin/varnishtest/tests/s00010.vtc
index 456d48741..b591c0b6c 100644
--- a/bin/varnishtest/tests/s00010.vtc
+++ b/bin/varnishtest/tests/s00010.vtc
@@ -5,52 +5,57 @@ feature cmd {test $(uname) != "SunOS" && test $(uname) != "Darwin"}
feature SO_RCVTIMEO_WORKS
-server s1 {
+barrier b1 cond 2 -cyclic
+barrier b2 cond 2 -cyclic
+
+server s1 -repeat 2 {
+ fatal
rxreq
- txresp -bodylen 100000
+ txresp -nolen -hdr "Transfer-encoding: chunked"
+ chunkedlen 100000
+ # make sure varnish is stuck in delivery
+ barrier b1 sync
+ non_fatal
+ chunkedlen 0
} -start
-varnish v1 \
- -arg "-p timeout_idle=1" \
- -arg "-p idle_send_timeout=.1" \
- -arg "-p send_timeout=.1" \
- -arg "-a 127.0.0.1:0" \
- -vcl+backend {
- import debug;
+varnish v1 -cliok "param.set debug +syncvsl"
+varnish v1 -cliok "param.set debug +flush_head"
+varnish v1 -cliok "param.set thread_pools 1"
+varnish v1 -cliok "param.set timeout_idle 1"
+varnish v1 -cliok "param.set idle_send_timeout .1"
+varnish v1 -cliok "param.set send_timeout .1"
- sub vcl_deliver {
- debug.sndbuf(128b);
- }
+varnish v1 -vcl+backend {
+ import debug;
+ sub vcl_recv { return (pass); }
+ sub vcl_deliver { debug.sndbuf(256b); }
} -start
-logexpect l1 -v v1 {
- expect * * Debug "Hit total send timeout"
+logexpect l1 -v v1 -g raw {
+ expect * 1001 Debug "Hit total send timeout"
} -start
-client c1 -rcvbuf 128 {
+client c1 -rcvbuf 256 {
txreq
- non_fatal
rxresphdrs
- # keep the session open for 4 seconds
- delay 4
+ # varnish is stuck sending the chunk
+ barrier b1 sync
+ # wait for the timeout to kick in
+ barrier b2 sync
} -start
-client c1 -wait
logexpect l1 -wait
+barrier b2 sync
+client c1 -wait
-varnish v1 -cliok "param.set idle_send_timeout 1"
varnish v1 -cliok "param.reset send_timeout"
-logexpect l2 -v v1 {
- expect * * Debug "Hit idle send timeout"
-} -start
-
-client c2 -rcvbuf 128 {
- txreq
- rxresphdrs
- # keep the session open for 4 seconds
- delay 4
+logexpect l2 -v v1 -g raw {
+ expect * 1004 Debug "Hit idle send timeout"
} -start
-client c2 -wait
+client c1 -start
logexpect l2 -wait
+barrier b2 sync
+client c1 -wait
More information about the varnish-commit
mailing list