[Varnish] #1772: first_byte_timeout is ignored when re-using a backend connection (HTTP Keep Alive)
Varnish
varnish-bugs at varnish-cache.org
Wed Aug 5 16:12:48 CEST 2015
#1772: first_byte_timeout is ignored when re-using a backend connection (HTTP Keep
Alive)
--------------------+------------------------
Reporter: tnt | Owner:
Type: defect | Status: new
Priority: normal | Milestone:
Component: build | Version: 4.1.0-TP1
Severity: normal | Resolution:
Keywords: |
--------------------+------------------------
Comment (by Dridi):
My comments from the IRC:
> my understanding is the following
> we should pass a timeout to VBT_Wait, to be used with the underlying
cond wait
> the cond wait being done in a loop, that means more system calls to re-
compute the deadline on each iteration
> (which means it would probably not be done this way)
> after a vbt wait, we could compute the remaining timeout and pass it to
V1F_FetchRespHdr
> I don't remember how vcl_pipe deals with timeouts, so that has to be
considered too
Then I wrote a test case:
{{{
varnishtest "honour first-byte timeout on a stolen connection"
server s1 {
rxreq
expect req.url == "/first"
txresp -hdr "Connection: keep-alive"
rxreq
expect req.url == "/stolen"
txresp
delay 1.5
rxreq
expect req.url == "/second"
txresp
} -start
varnish v1 -vcl {
backend s1 {
.host = "${s1_addr}";
.port = "${s1_port}";
.max_connections = 1;
.first_byte_timeout = 1s;
}
} -start
client c1 {
txreq -url "/first"
rxresp
expect resp.status == 200
sema r1 sync 2
sema r2 sync 2
txreq -url "/second"
rxresp
expect resp.status == 503
} -start
client c2 {
sema r1 sync 2
txreq -url "/stolen"
rxresp
expect resp.status == 200
sema r2 sync 2
} -start
client c1 -wait
}}}
And the thing that is puzzling me is that I couldn't make the test pass by
moving the '''delay''' right before the last '''txresp''' in s1.
--
Ticket URL: <https://www.varnish-cache.org/trac/ticket/1772#comment:1>
Varnish <https://varnish-cache.org/>
The Varnish HTTP Accelerator
More information about the varnish-bugs
mailing list