<div dir="ltr"><div><div>Hi,<br><br></div><div>Catching up with my email I came across your post.<br><br></div>The problem with your test is that while you're delaying the accept(), the connection is not refused (the socket is in listen state) so you are actually exercising the read timeout (first_byte_timeout).<br><br></div>You could use $(bad_ip} to test the connection timeout, that'd work.<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Sun, Nov 15, 2015 at 5:58 PM, Geoff Simmons <span dir="ltr"><<a href="mailto:geoff@uplex.de" target="_blank">geoff@uplex.de</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hello all,<br>
<br>
I noticed that there is no test case for backend connect_timeout among<br>
the Varnish *.vtc's, so I tried to cook one up for a VMOD, but I can't<br>
seem to get a backend connection to fail due to the timeout when I think<br>
it should.<br>
<br>
The attached VTC just uses standard Varnish, and doesn't pass. I can't<br>
see what could be wrong about VTCP_connect(), so I assume that my<br>
reasoning about the test case must be flawed.<br>
<br>
The first request gets "Connection: close" from the backend, and I can<br>
see BackendClose in the log.<br>
<br>
Then the client sends the second request:<br>
<br>
**   c1    0.6 === txreq<br>
**** c1    0.6 txreq| GET / HTTP/1.1\r\n<br>
**** c1    0.6 txreq| \r\n<br>
**   c1    0.6 === rxresp<br>
<br>
But the backend delays 1.5 seconds, which is longer than<br>
connect_timeout, before accepting again:<br>
<br>
**   s1    0.6 === delay 1.5<br>
***  s1    0.6 delaying 1.5 second(s)<br>
[...]<br>
**   s1    2.1 === accept<br>
**** s1    2.1 Accepting<br>
***  s1    2.1 Accepted socket fd is 4<br>
**   s1    2.1 === rxreq<br>
<br>
So I thought the timeout should elapse and the response should be 503,<br>
but it's 200, no failure.<br>
<br>
How am I getting this wrong?<br>
<br>
<br>
Thanks,<br>
Geoff<br>
<span class="HOEnZb"><font color="#888888">--<br>
** * * UPLEX - Nils Goroll Systemoptimierung<br>
<br>
Scheffelstraße 32<br>
22301 Hamburg<br>
<br>
Tel <a href="tel:%2B49%2040%202880%205731" value="+494028805731">+49 40 2880 5731</a><br>
Mob <a href="tel:%2B49%20176%20636%2090917" value="+4917663690917">+49 176 636 90917</a><br>
Fax <a href="tel:%2B49%2040%2042949753" value="+494042949753">+49 40 42949753</a><br>
<br>
<a href="http://uplex.de" rel="noreferrer" target="_blank">http://uplex.de</a><br>
</font></span><br>_______________________________________________<br>
varnish-dev mailing list<br>
<a href="mailto:varnish-dev@varnish-cache.org">varnish-dev@varnish-cache.org</a><br>
<a href="https://www.varnish-cache.org/lists/mailman/listinfo/varnish-dev" rel="noreferrer" target="_blank">https://www.varnish-cache.org/lists/mailman/listinfo/varnish-dev</a><br></blockquote></div><br></div>