Mailing List Archive

#1806: one minute delay on return (pipe) and a POST-Request
#1806: one minute delay on return (pipe) and a POST-Request
-------------------+----------------------
Reporter: butzi | Type: defect
Status: new | Priority: normal
Milestone: | Component: varnishd
Version: 4.1.0 | Severity: major
Keywords: |
-------------------+----------------------
sending a POST-Request to a ressource that is return (pipe); in vcl_fetch
results sometimes (but quite often >50%) in a delayed delivery of nearly
one minute.

The parts of my vcl:
{{{
sub vcl_fetch {
...
if (req.http.host ~ "callcenter") {
return (pipe);
}
...
}

sub vcl_pipe {
set bereq.http.connection = "close";
return (pipe);
}
}}}

A line from varnishlog:
{{{
- Timestamp PipeSess: 1445515486.047836 61.341283 61.340986
}}}

Sometimes the value of the second and third number is 0.xxx seconds, so
there is not a 100% failure. Calling GET-Ressources are working all the
time, there is no delay detected.

Sending the request directly to the apache server (without varnish in the
middle), there is no delay.

Currently the workaround for this bug is, to pass the ressource to the
backends, but this should not be the default way for the future.

--
Ticket URL: <https://www.varnish-cache.org/trac/ticket/1806>
Varnish <https://varnish-cache.org/>
The Varnish HTTP Accelerator

_______________________________________________
varnish-bugs mailing list
varnish-bugs@varnish-cache.org
https://www.varnish-cache.org/lists/mailman/listinfo/varnish-bugs
Re: #1806: one minute delay on return (pipe) and a POST-Request [ In reply to ]
#1806: one minute delay on return (pipe) and a POST-Request
----------------------+-----------------------
Reporter: butzi | Owner:
Type: defect | Status: needinfo
Priority: normal | Milestone:
Component: varnishd | Version: 4.1.0
Severity: major | Resolution:
Keywords: |
----------------------+-----------------------
Changes (by fgsch):

* status: new => needinfo


Comment:

Is this something you can reproduce? Do you have some varnishlog output
you can share?

The delay might come from the server sending the response or from client
reading it.

--
Ticket URL: <https://www.varnish-cache.org/trac/ticket/1806#comment:1>
Varnish <https://varnish-cache.org/>
The Varnish HTTP Accelerator

_______________________________________________
varnish-bugs mailing list
varnish-bugs@varnish-cache.org
https://www.varnish-cache.org/lists/mailman/listinfo/varnish-bugs
Re: #1806: one minute delay on return (pipe) and a POST-Request [ In reply to ]
#1806: one minute delay on return (pipe) and a POST-Request
----------------------+-----------------------
Reporter: butzi | Owner:
Type: defect | Status: needinfo
Priority: normal | Milestone:
Component: varnishd | Version: 4.1.0
Severity: major | Resolution:
Keywords: |
----------------------+-----------------------

Comment (by butzi):

Yes, i can reproduce this.

It makes no sense to me, when i handle the request with "return(pass)"
instead of "return(pipe)" that it is not a varnish problem, right? The
backends are not having the problems, when i access them without varnish.

the client request:
{{{
* << Request >> 380191421
- Begin req 380191413 rxreq
- Timestamp Start: 1446459772.600275 0.000000 0.000000
- Timestamp Req: 1446459772.600275 0.000000 0.000000
- ReqStart 37.49.xxx.xxx 34154
- ReqMethod POST
- ReqURL /index.php?cl=ecs_prudsys_recos_ajax
- ReqProtocol HTTP/1.1
- ReqHeader Host: domain.tld
- ReqHeader Connection: keep-alive
- ReqHeader Content-Length: 97
- ReqHeader Accept: application/json, text/javascript, */*; q=0.01
- ReqHeader Origin: http://domain.tld
- ReqHeader X-Requested-With: XMLHttpRequest
- ReqHeader User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64)
AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.80 Safari/537.36
- ReqHeader Content-Type: application/x-www-form-urlencoded;
charset=UTF-8
- ReqHeader Referer: http://domain.tld
- ReqHeader Accept-Encoding: gzip, deflate
- ReqHeader Accept-Language: fr-FR,fr;q=0.8,en-US;q=0.6,en;q=0.4
- ReqHeader Cookie: _ems_visitor=650367453.533136231;
heias_0=a%3A2%3A%7Bi%3A0%3Bs%3A4%3A%22TRUE%22%3Bi%3A1%3Bi%3A1446458945%3B%7D;
heias_sc=1; ctest2=1; SHOPDIRECT=none; sid_key=oxid; ecsadmatch=1;
heias_pid=144645894528888948380; recoUser2session=0; language=3; re
- ReqHeader X-Forwarded-For: 77.157.xxx.xxx
- ReqHeader X-Real-IP: 77.157.xxx.xxx
- ReqHeader X-CBR-IP: 77.157.xxx.xxx
- ReqUnset X-Forwarded-For: 77.157.xxx.xxx
- ReqHeader X-Forwarded-For: 77.157.xxx.xxx, 37.49.xxx.xxx
- VCL_call RECV
- ReqHeader X-UA-Device: Desktop
- ReqHeader x-url: /index.php?cl=ecs_prudsys_recos_ajax
- ReqHeader x-esi-level: 0
- VCL_return pipe
- VCL_call HASH
- ReqURL /index.php?cl=ecs_prudsys_recos_ajax
- VCL_return lookup
- Link bereq 380191422 pipe
- Timestamp Pipe: 1446459772.600482 0.000207 0.000207
- Timestamp PipeSess: 1446459832.773508 60.173233 60.173026
- PipeAcct 1086 1200 97 7360
- End

}}}

the server request:
{{{
* << BeReq >> 380191422
- Begin bereq 380191421 pipe
- BereqMethod POST
- BereqURL /index.php?cl=ecs_prudsys_recos_ajax
- BereqProtocol HTTP/1.1
- BereqHeader Host: domain.tld
- BereqHeader Connection: keep-alive
- BereqHeader Content-Length: 97
- BereqHeader Accept: application/json, text/javascript, */*; q=0.01
- BereqHeader Origin: http://domain.tld
- BereqHeader X-Requested-With: XMLHttpRequest
- BereqHeader User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64)
AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.80 Safari/537.36
- BereqHeader Content-Type: application/x-www-form-urlencoded;
charset=UTF-8
- BereqHeader Referer: http://domain.tld
- BereqHeader Accept-Encoding: gzip, deflate
- BereqHeader Accept-Language: fr-FR,fr;q=0.8,en-US;q=0.6,en;q=0.4
- BereqHeader Cookie: _ems_visitor=650367453.533136231;
heias_0=a%3A2%3A%7Bi%3A0%3Bs%3A4%3A%22TRUE%22%3Bi%3A1%3Bi%3A1446458945%3B%7D;
heias_sc=1; ctest2=1; SHOPDIRECT=none; sid_key=oxid; ecsadmatch=1;
heias_pid=144645894528888948380; recoUser2session=0; language=3; re
- BereqHeader X-Real-IP: 77.157.xxx.xxx
- BereqHeader X-CBR-IP: 77.157.xxx.xxx
- BereqHeader X-Forwarded-For: 77.157.xxx.xxx, 37.49.xxx.xxx
- BereqHeader X-UA-Device: Desktop
- BereqHeader x-url: /index.php?cl=ecs_prudsys_recos_ajax
- BereqHeader x-esi-level: 0
- BereqHeader X-Varnish: 380191421
- BereqHeader Connection: close
- VCL_call PIPE
- BereqUnset Connection: keep-alive
- BereqUnset Connection: close
- BereqHeader connection: close
- VCL_return pipe
- BackendOpen 47 u1.prodas06 10.4.132.21 80 10.4.132.2 59156
- Timestamp Bereq: 1446459772.600479 0.000000 0.000000
- BackendClose 47 u1.prodas06
- BereqAcct 0 0 0 0 0 0
- End
}}}

--
Ticket URL: <https://www.varnish-cache.org/trac/ticket/1806#comment:2>
Varnish <https://varnish-cache.org/>
The Varnish HTTP Accelerator

_______________________________________________
varnish-bugs mailing list
varnish-bugs@varnish-cache.org
https://www.varnish-cache.org/lists/mailman/listinfo/varnish-bugs
Re: #1806: one minute delay on return (pipe) and a POST-Request [ In reply to ]
#1806: one minute delay on return (pipe) and a POST-Request
----------------------+-----------------------
Reporter: butzi | Owner:
Type: defect | Status: needinfo
Priority: normal | Milestone:
Component: varnishd | Version: 4.1.0
Severity: major | Resolution:
Keywords: |
----------------------+-----------------------

Comment (by aondio):

Hi,
when you compiled the bug report you indicated 4.1 as the Varnish version
you are using, but, the VCL you pasted seems a varnish 3.x VCL.
That VCL wouldn't compile against V4.1, "sub vcl_fetch" is called "sub
vcl_backend_fetch" starting from V4.0 and a "return(pipe)" is not allowed
in that subroutine.
Can you please give use the complete VCL you are using and the correct
varnish version(varnishd -V)?

Also, can you try to lower the pipe_timeout a little bit and check if the
issue persists?

--
Ticket URL: <https://www.varnish-cache.org/trac/ticket/1806#comment:3>
Varnish <https://varnish-cache.org/>
The Varnish HTTP Accelerator

_______________________________________________
varnish-bugs mailing list
varnish-bugs@varnish-cache.org
https://www.varnish-cache.org/lists/mailman/listinfo/varnish-bugs
Re: #1806: one minute delay on return (pipe) and a POST-Request [ In reply to ]
#1806: one minute delay on return (pipe) and a POST-Request
----------------------+-----------------------
Reporter: butzi | Owner:
Type: defect | Status: needinfo
Priority: normal | Milestone:
Component: varnishd | Version: 4.1.0
Severity: major | Resolution:
Keywords: |
----------------------+-----------------------

Comment (by butzi):

Oh, my fault. vcl_recv was meant instead as vcl_fetch.

--
Ticket URL: <https://www.varnish-cache.org/trac/ticket/1806#comment:4>
Varnish <https://varnish-cache.org/>
The Varnish HTTP Accelerator

_______________________________________________
varnish-bugs mailing list
varnish-bugs@varnish-cache.org
https://www.varnish-cache.org/lists/mailman/listinfo/varnish-bugs
Re: #1806: one minute delay on return (pipe) and a POST-Request [ In reply to ]
#1806: one minute delay on return (pipe) and a POST-Request
----------------------+-----------------------
Reporter: butzi | Owner:
Type: defect | Status: needinfo
Priority: normal | Milestone:
Component: varnishd | Version: 4.1.0
Severity: major | Resolution:
Keywords: |
----------------------+-----------------------

Comment (by aondio):

Hi, again, thanks for the answer.
Can I also have the complete VCL you are using?

Please, also try to "play" with the pipe_timeout as described in my
previous comment.

--
Ticket URL: <https://www.varnish-cache.org/trac/ticket/1806#comment:5>
Varnish <https://varnish-cache.org/>
The Varnish HTTP Accelerator

_______________________________________________
varnish-bugs mailing list
varnish-bugs@varnish-cache.org
https://www.varnish-cache.org/lists/mailman/listinfo/varnish-bugs
Re: #1806: one minute delay on return (pipe) and a POST-Request [ In reply to ]
#1806: one minute delay on return (pipe) and a POST-Request
----------------------+-----------------------
Reporter: butzi | Owner:
Type: defect | Status: needinfo
Priority: normal | Milestone:
Component: varnishd | Version: 4.1.0
Severity: major | Resolution:
Keywords: |
----------------------+-----------------------

Comment (by butzi):

Hi, sorry the complete vcl is not possible. In front of the posted part
above is only a part where different backends are choosen in conditions,
which are not met be the request with the problem.

I did not changed the pipe_timeout until now, so it is on 60s by default.
Changing this to a lower value could become a problem. As far as i could
find some infos to this value, it should be the same value as
first_byte_timeout or longer, but not shorter.

I will take look if there is a way to test the timeout and the other ones
with 60s default, but this will take some time.

--
Ticket URL: <https://www.varnish-cache.org/trac/ticket/1806#comment:6>
Varnish <https://varnish-cache.org/>
The Varnish HTTP Accelerator

_______________________________________________
varnish-bugs mailing list
varnish-bugs@varnish-cache.org
https://www.varnish-cache.org/lists/mailman/listinfo/varnish-bugs
Re: #1806: one minute delay on return (pipe) and a POST-Request [ In reply to ]
#1806: one minute delay on return (pipe) and a POST-Request
----------------------+-----------------------
Reporter: butzi | Owner:
Type: defect | Status: needinfo
Priority: normal | Milestone:
Component: varnishd | Version: 4.1.0
Severity: major | Resolution:
Keywords: |
----------------------+-----------------------

Comment (by aondio):

Hi,
I've created a test case which tries to reproduce this issue, in the test
case I've used the above VCL, so far I haven't been able to make that test
case fail as in you case, this is why I need the your real VCL.

If I can't get access to the complete VCL, I would also appreciate only
part of it, such as the complete vcl_recv and the complete vcl_pipe. If
you don't want to post it here, you can send it to arianna.aondio@varnish-
software.com

--
Ticket URL: <https://www.varnish-cache.org/trac/ticket/1806#comment:7>
Varnish <https://varnish-cache.org/>
The Varnish HTTP Accelerator

_______________________________________________
varnish-bugs mailing list
varnish-bugs@varnish-cache.org
https://www.varnish-cache.org/lists/mailman/listinfo/varnish-bugs
Re: #1806: one minute delay on return (pipe) and a POST-Request [ In reply to ]
#1806: one minute delay on return (pipe) and a POST-Request
----------------------+-----------------------
Reporter: butzi | Owner:
Type: defect | Status: needinfo
Priority: normal | Milestone:
Component: varnishd | Version: 4.1.0
Severity: major | Resolution:
Keywords: |
----------------------+-----------------------

Comment (by butzi):

I send you the VCL via Mail. I also send you some details, how you could
reproduce this on our live setup.

--
Ticket URL: <https://www.varnish-cache.org/trac/ticket/1806#comment:8>
Varnish <https://varnish-cache.org/>
The Varnish HTTP Accelerator

_______________________________________________
varnish-bugs mailing list
varnish-bugs@varnish-cache.org
https://www.varnish-cache.org/lists/mailman/listinfo/varnish-bugs
Re: #1806: one minute delay on return (pipe) and a POST-Request [ In reply to ]
#1806: one minute delay on return (pipe) and a POST-Request
----------------------+-----------------------
Reporter: butzi | Owner:
Type: defect | Status: needinfo
Priority: normal | Milestone:
Component: varnishd | Version: 4.1.0
Severity: major | Resolution:
Keywords: |
----------------------+-----------------------

Comment (by Hilaus):

I have the same problem. Did you resolve it?

--
Ticket URL: <https://www.varnish-cache.org/trac/ticket/1806#comment:9>
Varnish <https://varnish-cache.org/>
The Varnish HTTP Accelerator

_______________________________________________
varnish-bugs mailing list
varnish-bugs@varnish-cache.org
https://www.varnish-cache.org/lists/mailman/listinfo/varnish-bugs
Re: #1806: one minute delay on return (pipe) and a POST-Request [ In reply to ]
#1806: one minute delay on return (pipe) and a POST-Request
----------------------+-----------------------
Reporter: butzi | Owner:
Type: defect | Status: needinfo
Priority: normal | Milestone:
Component: varnishd | Version: 4.1.0
Severity: major | Resolution:
Keywords: |
----------------------+-----------------------

Comment (by aondio):

Replying to [comment:9 Hilaus]:
> I have the same problem. Did you resolve it?
It's on my to-do list.

--
Ticket URL: <https://www.varnish-cache.org/trac/ticket/1806#comment:10>
Varnish <https://varnish-cache.org/>
The Varnish HTTP Accelerator

_______________________________________________
varnish-bugs mailing list
varnish-bugs@varnish-cache.org
https://www.varnish-cache.org/lists/mailman/listinfo/varnish-bugs
Re: #1806: one minute delay on return (pipe) and a POST-Request [ In reply to ]
#1806: one minute delay on return (pipe) and a POST-Request
----------------------+-----------------------
Reporter: butzi | Owner:
Type: defect | Status: needinfo
Priority: normal | Milestone:
Component: varnishd | Version: 4.1.0
Severity: major | Resolution:
Keywords: |
----------------------+-----------------------

Comment (by Hilaus):

More information:

In my case, It’s with POST requests only, and only with Magento (I suppose
because Magento uses different VCL from others that POST works fine).

With 4.0.3 works perfectly, the problem is only with 4.1. The same system
and configuration with 4.0.3 works fine. I update varnish to 4.1, and POST
requests starts to fails (it waits 30s and send a timeout).

A example when that happens (in this case, the host doesn't have SSL. But
with SSL happens the same):


{{{
* << Request >> 458793
- Begin req 458790 rxreq
- Timestamp Start: 1447974382.917233 0.000000 0.000000
- Timestamp Req: 1447974382.917233 0.000000 0.000000
- ReqStart XX.XX.XX.XX 58583
- ReqMethod POST
- ReqURL
/checkout/cart/add/uenc/aHR0cDovL3d3dy5tdWVibGVzb3V0bGV0LmVzL21lc2EtZXN0dWRpby1ibGFuY2E,/product/93/form_key/3hgT3E2WEqG4scwk/
- ReqProtocol HTTP/1.1
- ReqHeader Host: www.example.com
- ReqHeader Accept:
text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
- ReqHeader Accept-Encoding: gzip, deflate
- ReqHeader Accept-Language: en-us
- ReqHeader Content-Type: application/x-www-form-urlencoded
- ReqHeader Origin: http://www.example.com
- ReqHeader Content-Length: 59
- ReqHeader Connection: keep-alive
- ReqHeader User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X
10_11_1) AppleWebKit/601.2.7 (KHTML, like Gecko) Version/9.0.1
Safari/601.2.7
- ReqHeader Referer: http://www.example.com/some-product
- ReqHeader DNT: 1
- ReqHeader Cookie: adminhtml=ieoo7or9epsnc18c4d9vt8brg2;
customer_group=1; external_no_cache=1;
frontend=2a56054eba7a4a7a896447b305372ee4;
persistent_shopping_cart=cYHH5sXPRS7KeXFmzr4RG4bG3b58xlwXJVJKgtpNcgjOKdndVH;
__utma=56641590.1642689172.1423557126.1447941509.
- ReqHeader X-Forwarded-For: XX.XX.XX.XX
- VCL_call RECV
- ReqUnset X-Forwarded-For: XX.XX.XX.XX
- ReqHeader X-Forwarded-For: XX.XX.XX.XX, XX.XX.XX.XX
- VCL_return pipe
- VCL_call HASH
- VCL_return lookup
- Link bereq 458794 pipe
- Timestamp Pipe: 1447974382.917345 0.000112 0.000112
- Timestamp PipeSess: 1447974412.917846 30.000613 30.000501
- PipeAcct 1118 1175 0 0
- End
}}}

--
Ticket URL: <https://www.varnish-cache.org/trac/ticket/1806#comment:11>
Varnish <https://varnish-cache.org/>
The Varnish HTTP Accelerator

_______________________________________________
varnish-bugs mailing list
varnish-bugs@varnish-cache.org
https://www.varnish-cache.org/lists/mailman/listinfo/varnish-bugs
Re: #1806: one minute delay on return (pipe) and a POST-Request [ In reply to ]
#1806: one minute delay on return (pipe) and a POST-Request
----------------------+-----------------------
Reporter: butzi | Owner:
Type: defect | Status: needinfo
Priority: normal | Milestone:
Component: varnishd | Version: 4.1.0
Severity: major | Resolution:
Keywords: |
----------------------+-----------------------

Comment (by Hilaus):

Do you need more information?

--
Ticket URL: <https://www.varnish-cache.org/trac/ticket/1806#comment:12>
Varnish <https://varnish-cache.org/>
The Varnish HTTP Accelerator

_______________________________________________
varnish-bugs mailing list
varnish-bugs@varnish-cache.org
https://www.varnish-cache.org/lists/mailman/listinfo/varnish-bugs
Re: #1806: one minute delay on return (pipe) and a POST-Request [ In reply to ]
#1806: one minute delay on return (pipe) and a POST-Request
----------------------+-----------------------
Reporter: butzi | Owner:
Type: defect | Status: needinfo
Priority: normal | Milestone:
Component: varnishd | Version: 4.1.0
Severity: major | Resolution:
Keywords: |
----------------------+-----------------------

Comment (by thomaslc):

Think I have the problem too. For me it seems a piped POST request fails
when it reuses a backend connection that previously PASSed requests. It
works when retrying after a failure because a new backend connection is
opened.

Here is the (anonymized) varnishlog output. The client does a first
request that ends up in a pass, and then a second one ending up with a
pipe.

{{{
* << Session >> 21123429
- Begin sess 0 HTTP/1
- SessOpen CLIENT_IP 32470 :80 VARNISH_IP 80 1452591080.300133 51
- Link req 21123430 rxreq
- SessClose REM_CLOSE 5.135
- End
** << Request >> 21123430
-- Begin req 21123429 rxreq
-- Timestamp Start: 1452591080.300852 0.000000 0.000000
-- Timestamp Req: 1452591080.300852 0.000000 0.000000
-- ReqStart CLIENT_IP 32470
-- ReqMethod GET
-- ReqURL /images/REDACTED
-- ReqProtocol HTTP/1.1
-- ReqHeader Host: img.directindustry.fr
-- ReqHeader Connection: keep-alive
-- ReqHeader Pragma: no-cache
-- ReqHeader Cache-Control: no-cache
-- ReqHeader Accept: image/webp,image/*,*/*;q=0.8
-- ReqHeader User-Agent: Mozilla/5.0 (X11; Linux x86_64)
AppleWebKit/537.36 (KHTML, like Gecko) Chrome/47.0.2526.80 Safari/537.36
-- ReqHeader DNT: 1
-- ReqHeader Referer: http://REDACTED
-- ReqHeader Accept-Encoding: gzip, deflate, sdch
-- ReqHeader Accept-Language: en-US,en;q=0.8,fr;q=0.6
-- ReqHeader Cookie: cookieAllowed=1;
__gads=ID=8e63413b2db7cdc9:T=1445582966:S=ALNI_MbI6b5xwPjrR2dJO-
5YVDmoZxGDng; __unam=409b964-1509375ef74-804c90-9;
kameleoonVisit=6l6b56grglamufva/0/1445583360532/20150708/0/;
__utma=115893401.330538632.1444723972.1445582991.1448
-- ReqHeader X-Forwarded-For: CLIENT_IP
-- VCL_call RECV
-- ReqHeader X-Int-Backend: orig
-- ReqUnset X-Forwarded-For: CLIENT_IP
-- ReqHeader X-Forwarded-For: CLIENT_IP
-- ReqHeader X-VE-Hops: 1
-- ReqUnset Accept-Encoding: gzip, deflate, sdch
-- ReqHeader Accept-Encoding: gzip
-- ReqUnset Cookie: cookieAllowed=1;
__gads=ID=8e63413b2db7cdc9:T=1445582966:S=ALNI_MbI6b5xwPjrR2dJO-
5YVDmoZxGDng; __unam=409b964-1509375ef74-804c90-9;
kameleoonVisit=6l6b56grglamufva/0/1445583360532/20150708/0/;
__utma=115893401.330538632.1444723972.1445582991.1448
-- ReqHeader X-Host-Subdomain: img
-- VCL_return pass
-- VCL_call HASH
-- ReqHeader X-VE-Host: img.directindustry
-- VCL_return lookup
-- VCL_call PASS
-- ReqHeader X-Varnish-Mode: pass
-- VCL_return fetch
-- Link bereq 21123431 pass
-- Timestamp Fetch: 1452591080.386848 0.085996 0.085996
-- RespProtocol HTTP/1.1
-- RespStatus 200
-- RespReason OK
-- RespHeader Date: Tue, 12 Jan 2016 09:31:20 GMT
-- RespHeader Server: Apache
-- RespHeader Last-Modified: Mon, 01 Dec 2014 13:59:16 GMT
-- RespHeader ETag: "2a8403d-4c8-50928041f647c"
-- RespHeader Content-Length: 1224
-- RespHeader X-From: 3-10 in D=365 microseconds
-- RespHeader X-Content-Type-Options: nosniff
-- RespHeader X-XSS-Protection: 1; mode=block
-- RespHeader Content-Type: image/gif
-- RespHeader X-Varnish-Origin-TTL: 0.000
-- RespHeader X-Cache: nc[arz01/s] conn[>origin]
-- RespHeader X-Host: img.directindustry.fr
-- RespHeader X-Url: /images_di/REDACTED
-- RespHeader X-Host-Subdomain: img
-- RespHeader X-Varnish-Retries: 0
-- RespHeader X-Varnish: 21123430
-- RespHeader Age: 0
-- RespHeader Via: 1.1 varnish-v4
-- VCL_call DELIVER
-- VCL_Log VEMR:-
-- RespUnset X-Varnish-Retries: 0
-- RespUnset X-From: 3-10 in D=365 microseconds
-- RespUnset X-Host-Subdomain: img
-- RespUnset X-Url: /images_di/REDACTED
-- RespUnset X-Varnish-Origin-TTL: 0.000
-- RespUnset Via: 1.1 varnish-v4
-- RespUnset X-Varnish: 21123430
-- RespUnset X-Host: img.directindustry.fr
-- VCL_return deliver
-- Timestamp Process: 1452591080.386898 0.086046 0.000050
-- RespHeader Accept-Ranges: bytes
-- Debug "RES_MODE 2"
-- RespHeader Connection: keep-alive
-- Timestamp Resp: 1452591080.386958 0.086106 0.000060
-- ReqAcct 876 0 876 356 1224 1580
-- End
*** << BeReq >> 21123431
--- Begin bereq 21123430 pass
--- Timestamp Start: 1452591080.302007 0.000000 0.000000
--- BereqMethod GET
--- BereqURL /images_di/REDACTED
--- BereqProtocol HTTP/1.1
--- BereqHeader Host: img.directindustry.fr
--- BereqHeader Pragma: no-cache
--- BereqHeader Cache-Control: no-cache
--- BereqHeader Accept: image/webp,image/*,*/*;q=0.8
--- BereqHeader User-Agent: Mozilla/5.0 (X11; Linux x86_64)
AppleWebKit/537.36 (KHTML, like Gecko) Chrome/47.0.2526.80 Safari/537.36
--- BereqHeader DNT: 1
--- BereqHeader Referer: http://www.directindustry.fr/BACKOFFICE---
REDACTED
--- BereqHeader Accept-Language: en-US,en;q=0.8,fr;q=0.6
--- BereqHeader X-Int-Backend: orig
--- BereqHeader X-Forwarded-For: CLIENT_IP
--- BereqHeader X-VE-Hops: 1
--- BereqHeader Accept-Encoding: gzip
--- BereqHeader X-Host-Subdomain: img
--- BereqHeader X-VE-Host: img.directindustry
--- BereqHeader X-Varnish-Mode: pass
--- BereqHeader X-Varnish: 21123431
--- VCL_call BACKEND_FETCH
--- BereqProtocol HTTP/1.1
--- VCL_return fetch
--- BackendOpen 56 c62563df-b4d7-421a-915e-5c448e453d00.agk01
BACKEND_IP 80 VARNISH_IP 33974
--- Timestamp Bereq: 1452591080.331480 0.029472 0.029472
--- Timestamp Beresp: 1452591080.386700 0.084693 0.055221
--- BerespProtocol HTTP/1.1
--- BerespStatus 200
--- BerespReason OK
--- BerespHeader Date: Tue, 12 Jan 2016 09:31:20 GMT
--- BerespHeader Server: Apache
--- BerespHeader Last-Modified: Mon, 01 Dec 2014 13:59:16 GMT
--- BerespHeader ETag: "2a8403d-4c8-50928041f647c"
--- BerespHeader Accept-Ranges: bytes
--- BerespHeader Content-Length: 1224
--- BerespHeader X-From: 3-10 in D=365 microseconds
--- BerespHeader X-Content-Type-Options: nosniff
--- BerespHeader X-XSS-Protection: 1; mode=block
--- BerespHeader Content-Type: image/gif
--- TTL RFC 432000 10 -1 1452591080 1452591080 1452591080 0 0
--- VCL_call BACKEND_RESPONSE
--- BerespHeader X-Varnish-Origin-TTL: 0.000
--- TTL VCL -1 60 0 1452591080
--- BerespHeader X-Cache: conn[>origin]
--- BerespUnset X-Cache: conn[>origin]
--- BerespHeader X-Cache: nc[arz01/s] conn[>origin]
--- BerespHeader X-Host: img.directindustry.fr
--- BerespHeader X-Url: /images_di/REDACTED
--- BerespHeader X-Host-Subdomain: img
--- BerespHeader X-Varnish-Retries: 0
--- BerespUnset Accept-Ranges: bytes
--- VCL_return deliver
--- Storage malloc Transient
--- ObjProtocol HTTP/1.1
--- ObjStatus 200
--- ObjReason OK
--- ObjHeader Date: Tue, 12 Jan 2016 09:31:20 GMT
--- ObjHeader Server: Apache
--- ObjHeader Last-Modified: Mon, 01 Dec 2014 13:59:16 GMT
--- ObjHeader ETag: "2a8403d-4c8-50928041f647c"
--- ObjHeader Content-Length: 1224
--- ObjHeader X-From: 3-10 in D=365 microseconds
--- ObjHeader X-Content-Type-Options: nosniff
--- ObjHeader X-XSS-Protection: 1; mode=block
--- ObjHeader Content-Type: image/gif
--- ObjHeader X-Varnish-Origin-TTL: 0.000
--- ObjHeader X-Cache: nc[arz01/s] conn[>origin]
--- ObjHeader X-Host: img.directindustry.fr
--- ObjHeader X-Url: /images/REDACTED
--- ObjHeader X-Host-Subdomain: img
--- ObjHeader X-Varnish-Retries: 0
--- Fetch_Body 3 length stream
--- BackendReuse 56 c62563df-b4d7-421a-915e-5c448e453d00.agk01
--- Timestamp BerespBody: 1452591080.386850 0.084843 0.000150
--- Length 1224
--- BereqAcct 603 0 603 324 1224 1548
--- End

* << Session >> 73570869
- Begin sess 0 HTTP/1
- SessOpen CLIENT_IP 31052 :80 VARNISH_IP 80 1452591082.783081 64
- Link req 73570870 rxreq
- SessClose TX_PIPE 10.172
- End
** << Request >> 73570870
-- Begin req 73570869 rxreq
-- Timestamp Start: 1452591082.784323 0.000000 0.000000
-- Timestamp Req: 1452591082.784323 0.000000 0.000000
-- ReqStart CLIENT_IP 31052
-- ReqMethod POST
-- ReqURL /AJAX---REDACTED
-- ReqProtocol HTTP/1.1
-- ReqHeader Host: www.directindustry.fr
-- ReqHeader Connection: keep-alive
-- ReqHeader Content-Length: 280
-- ReqHeader Pragma: no-cache
-- ReqHeader Cache-Control: no-cache
-- ReqHeader Accept: */*
-- ReqHeader Origin: http://www.directindustry.fr
-- ReqHeader X-Requested-With: XMLHttpRequest
-- ReqHeader User-Agent: Mozilla/5.0 (X11; Linux x86_64)
AppleWebKit/537.36 (KHTML, like Gecko) Chrome/47.0.2526.80 Safari/537.36
-- ReqHeader Content-Type: application/x-www-form-urlencoded;
charset=UTF-8
-- ReqHeader DNT: 1
-- ReqHeader Referer: http://www.directindustry.fr/BACKOFFICE---
REDACTED
-- ReqHeader Accept-Encoding: gzip, deflate
-- ReqHeader Accept-Language: en-US,en;q=0.8,fr;q=0.6
-- ReqHeader Cookie: REDACTED
-- ReqHeader X-Forwarded-For: CLIENT_IP
-- VCL_call RECV
-- ReqHeader X-Int-Backend: orig
-- ReqUnset X-Forwarded-For: CLIENT_IP
-- ReqHeader X-Forwarded-For: CLIENT_IP
-- ReqHeader X-VE-Hops: 1
-- ReqUnset Accept-Encoding: gzip, deflate
-- ReqHeader Accept-Encoding: gzip
-- VCL_return pipe
-- VCL_call HASH
-- VCL_return lookup
-- Link bereq 73570871 pipe
-- Timestamp Pipe: 1452591082.785460 0.001137 0.001137
-- Timestamp PipeSess: 1452591092.955365 10.171043 10.169906
-- PipeAcct 1378 1478 280 527
-- End
*** << BeReq >> 73570871
--- Begin bereq 73570870 pipe
--- BereqMethod POST
--- BereqURL /AJAX---REDACTED
--- BereqProtocol HTTP/1.1
--- BereqHeader Host: www.directindustry.fr
--- BereqHeader Connection: keep-alive
--- BereqHeader Content-Length: 280
--- BereqHeader Pragma: no-cache
--- BereqHeader Cache-Control: no-cache
--- BereqHeader Accept: */*
--- BereqHeader Origin: http://www.directindustry.fr
--- BereqHeader X-Requested-With: XMLHttpRequest
--- BereqHeader User-Agent: Mozilla/5.0 (X11; Linux x86_64)
AppleWebKit/537.36 (KHTML, like Gecko) Chrome/47.0.2526.80 Safari/537.36
--- BereqHeader Content-Type: application/x-www-form-urlencoded;
charset=UTF-8
--- BereqHeader DNT: 1
--- BereqHeader Referer: http://www.directindustry.fr/BACKOFFICE---
REDACTED
--- BereqHeader Accept-Language: en-US,en;q=0.8,fr;q=0.6
--- BereqHeader Cookie: callerLoad=function
editProduct(productID,containerID){load('Product-
editProduct',{productID:productID,containerID:containerID},function(request){openProduts([productID],request.getResponseHeader('containerIDs').split(','),productID);
callerGet=f
--- BereqHeader X-Int-Backend: orig
--- BereqHeader X-Forwarded-For: CLIENT_IP
--- BereqHeader X-VE-Hops: 1
--- BereqHeader Accept-Encoding: gzip
--- BereqHeader X-Varnish: 73570870
--- BereqHeader Connection: close
--- VCL_call PIPE
--- VCL_return pipe
--- BackendOpen 56 c62563df-b4d7-421a-915e-5c448e453d00.agk01
BACKEND_IP 80 VARNISH_IP 33974
--- Timestamp Bereq: 1452591082.785452 0.000000 0.000000
--- BackendClose 56 c62563df-b4d7-421a-915e-5c448e453d00.agk01
--- BereqAcct 0 0 0 0 0 0
--- End
}}}

The thing that got my attention was that the first request does a
BackendReuse on the backend connection 56. Then, the next request starts a
pipe (because ReqURL matches a specific backend URL). There, varnish does
a BackendOpen on 56, not a BackendReuse.

The tcpdump performed on the backend shows a rather weird sequence:

{{{
4 2016-01-12 10:16:30.494287 46.37.4.239 10.80.30.11
HTTP 669 GET /images_di/IMAGE---URL 0 HTTP/1.1
7 2016-01-12 10:16:30.498630 10.80.30.11 46.37.4.239
HTTP 247 HTTP/1.1 200 OK (GIF89a)
11 2016-01-12 10:16:42.835985 10.80.30.11 46.37.4.239
HTTP 593 HTTP/1.1 503 Service Unavailable (text/html)[Malformed
Packet]
14 2016-01-12 10:16:42.864200 46.37.4.239 10.80.30.11
HTTP 346 POST /BACKOFFICE---URL HTTP/1.1 (application/x-www-form-
urlencoded)
}}}

As you can see, the 503 error is sent by the backend BEFORE the piped
request is sent by varnish. This extract shows only the HTTP stuff. I can
send the complete PCAP dump with the TCP stuff by e-mail (it contains
sensitive data).

Thanks

Thomas

--
Ticket URL: <https://www.varnish-cache.org/trac/ticket/1806#comment:13>
Varnish <https://varnish-cache.org/>
The Varnish HTTP Accelerator

_______________________________________________
varnish-bugs mailing list
varnish-bugs@varnish-cache.org
https://www.varnish-cache.org/lists/mailman/listinfo/varnish-bugs
Re: #1806: one minute delay on return (pipe) and a POST-Request [ In reply to ]
#1806: one minute delay on return (pipe) and a POST-Request
----------------------+-----------------------
Reporter: butzi | Owner:
Type: defect | Status: needinfo
Priority: normal | Milestone:
Component: varnishd | Version: 4.1.0
Severity: major | Resolution:
Keywords: |
----------------------+-----------------------

Comment (by thomaslc):

OK, I think the following VTC is able to reproduce the bug:

{{{
server s1 {
rxreq
expect req.url == "/pass-me"
txresp -body "I was PASSed\n"

rxreq
expect req.url == "/pipe-me"
txresp -body "I was PIPEd\n"
} -start

varnish v1 -vcl+backend {

sub vcl_recv {
if (req.url == "/pipe-me") {
return (pipe);
}

return (pass);
}

sub vcl_pipe {
set bereq.http.Connection = "close";
}
} -start

client c1 {
txreq -url /pass-me
rxresp

txreq -req POST -url /pipe-me -body "asdf"
rxresp
} -run
}}}

If you change the flow to do the piped POST before the passed GET, it
works fine.
Also, if you change the POST request to a GET, it works fine.

--
Ticket URL: <https://www.varnish-cache.org/trac/ticket/1806#comment:14>
Varnish <https://varnish-cache.org/>
The Varnish HTTP Accelerator

_______________________________________________
varnish-bugs mailing list
varnish-bugs@varnish-cache.org
https://www.varnish-cache.org/lists/mailman/listinfo/varnish-bugs
Re: #1806: one minute delay on return (pipe) and a POST-Request [ In reply to ]
#1806: one minute delay on return (pipe) and a POST-Request
----------------------+-----------------------
Reporter: butzi | Owner:
Type: defect | Status: needinfo
Priority: normal | Milestone:
Component: varnishd | Version: 4.1.0
Severity: major | Resolution:
Keywords: |
----------------------+-----------------------

Comment (by fgsch):

I tested this against different version and this was introduced between
4.0.3 and 4.1.

--
Ticket URL: <https://www.varnish-cache.org/trac/ticket/1806#comment:15>
Varnish <https://varnish-cache.org/>
The Varnish HTTP Accelerator

_______________________________________________
varnish-bugs mailing list
varnish-bugs@varnish-cache.org
https://www.varnish-cache.org/lists/mailman/listinfo/varnish-bugs
Re: #1806: one minute delay on return (pipe) and a POST-Request [ In reply to ]
#1806: one minute delay on return (pipe) and a POST-Request
----------------------+-----------------------
Reporter: butzi | Owner:
Type: defect | Status: needinfo
Priority: normal | Milestone:
Component: varnishd | Version: 4.1.0
Severity: major | Resolution:
Keywords: |
----------------------+-----------------------

Comment (by fgsch):

Introduced in commit dd01df1a9138d6a2204a1a8de4e0dc727d8fc488

--
Ticket URL: <https://www.varnish-cache.org/trac/ticket/1806#comment:16>
Varnish <https://varnish-cache.org/>
The Varnish HTTP Accelerator

_______________________________________________
varnish-bugs mailing list
varnish-bugs@varnish-cache.org
https://www.varnish-cache.org/lists/mailman/listinfo/varnish-bugs
Re: #1806: one minute delay on return (pipe) and a POST-Request [ In reply to ]
#1806: one minute delay on return (pipe) and a POST-Request
----------------------+-----------------------
Reporter: butzi | Owner:
Type: defect | Status: needinfo
Priority: normal | Milestone:
Component: varnishd | Version: 4.1.0
Severity: major | Resolution:
Keywords: |
----------------------+-----------------------

Comment (by fgsch):

Related to #1772.

--
Ticket URL: <https://www.varnish-cache.org/trac/ticket/1806#comment:17>
Varnish <https://varnish-cache.org/>
The Varnish HTTP Accelerator

_______________________________________________
varnish-bugs mailing list
varnish-bugs@varnish-cache.org
https://www.varnish-cache.org/lists/mailman/listinfo/varnish-bugs