req.backend.healthy in VCL deliver is not always available and causes crash

Michal Paal michal.paal at digmia.com
Wed Mar 14 10:04:56 CET 2012


Hi,

We have found a problem with req.backend.healthy information.

in https://www.varnish-cache.org/docs/3.0/reference/vcl.html?highlight=req.backend.healthy#variables we can read "Although subroutines take no arguments, the necessary information is made available to the handler subroutines through global variables."

We have used set resp.http.X-H = req.backend.healthy; in vcl_deliver, and it was working fine, but after the backend went sick, and varnish recieved next request, child will die leaving this message in /var/log/messages

Mar 13 00:29:55 hostname-censored varnishd[9549]: Child (14754) Panic message: Assert error in VRT_r_req_backend_healthy(), cache_vrt_var.c line 539:#012  Condition((sp->director) != NULL) not true.#012thread = (cache-worker)#012ident = Linux,2.6.32-220.el6.x86_64,x86_64,-smalloc,-smalloc,-hcritbit,epoll#012Backtrace:#012  0x42c7a6: /usr/sbin/varnishd() [0x42c7a6]#012  0x4372d3: /usr/sbin/varnishd(VRT_r_req_backend_healthy+0xd3) [0x4372d3]#012  0x7fec62bf522d: ./vcl.RWdxVutw.so(+0x222d) [0x7fec62bf522d]#012  0x4331d6: /usr/sbin/varnishd(VCL_deliver_method+0x46) [0x4331d6]#012  0x4169f3: /usr/sbin/varnishd() [0x4169f3]#012  0x417a6e: /usr/sbin/varnishd(CNT_Session+0x9ae) [0x417a6e]#012  0x42efb8: /usr/sbin/varnishd() [0x42efb8]#012  0x42e19b: /usr/sbin/varnishd() [0x42e19b]#012  0x7fec6c9677f1: /lib64/libpthread.so.0(+0x77f1) [0x7fec6c9677f1]#012  0x7fec6c6a492d: /lib64/libc.so.6(clone+0x6d) [0x7fec6c6a492d]#012sp = 0x7fe9e5dbd008 {#012  fd = 52, id = 52, xid = 341045106,#012  client = 209.85.238.178 47081,#012  step = STP_PREPRESP,#012  handling = deliver,#012  restarts = 0, esi_level = 0#012  flags = #012  bodystatus = 4#012  ws = 0x7fe9e5dbd080 { #012    id = "sess",#012    {s,f,r,e} = {0x7fe9e5dbdc90,+448,(nil),+65536},#012  },#012  http[req] = {#012    ws = 0x7fe9e5dbd080[sess]#012      "GET",#012      "/xml/somexml.xml",#012      "HTTP/1.1",#012      "Connection: Keep-alive",#012      "Accept: */*",#012      "User-Agent: Feedfetcher-Google; (+http://www.google.com/feedfetcher.html; 114 subscribers; feed-id=5174819811214747333)",#012      "If-Modified-Since: Mon, 12 Mar 2012 22:30:53 GMT",#012      "X-Forwarded-For: 209.85.238.178",#012      "host: www.somepage.tld",#012      "Accept-Encoding: gzip",#012  },#012  worker = 0x7febbe0fea80 {#012    ws = 0x7febbe0fecc0 { #012      id = "wrk",#012      {s,f,r,e} = {0x7febbe0eca30,+168,(nil),+65536},#012    },#012    http[resp] = {#012      ws = 0x7febbe0fecc0[wrk]#012        "HTTP/1.1",#012        "Service Unavailable",#012        "Server: Varnish",#012        "Content-Type: tex

I assume this wil be bug, what do you think?

Thanks,


Michal Paal


http://www.digmia.com

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.varnish-cache.org/lists/pipermail/varnish-bugs/attachments/20120314/296d0608/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 5023 bytes
Desc: not available
URL: <https://www.varnish-cache.org/lists/pipermail/varnish-bugs/attachments/20120314/296d0608/attachment.bin>


More information about the varnish-bugs mailing list