[Varnish] #1621: Synth code path fails when no backend threads are available

Varnish varnish-bugs at varnish-cache.org
Wed Oct 29 10:27:51 CET 2014


#1621: Synth code path fails when no backend threads are available
----------------------+---------------------
 Reporter:  martin    |      Owner:
     Type:  defect    |     Status:  new
 Priority:  normal    |  Milestone:
Component:  varnishd  |    Version:  unknown
 Severity:  normal    |   Keywords:
----------------------+---------------------
 To test this situation, one can apply the following patch to Varnish:

 {{{
 --- a/bin/varnishd/cache/cache_fetch.c
 +++ b/bin/varnishd/cache/cache_fetch.c
 @@ -956,7 +956,7 @@ VBF_Fetch(struct worker *wrk, struct req *req, struct
 objcore *oc,
         bo->fetch_task.priv = bo;
         bo->fetch_task.func = vbf_fetch_thread;

 -       if (Pool_Task(wrk->pool, &bo->fetch_task, POOL_QUEUE_FRONT))
 +       /* if (Pool_Task(wrk->pool, &bo->fetch_task, POOL_QUEUE_FRONT)) */
                 vbf_fetch_thread(wrk, bo);
         if (mode == VBF_BACKGROUND) {
                 VBO_waitstate(bo, BOS_REQ_DONE);
 }}}

 Then e.g. test case b00038.vtc will produce an assert during the synth
 generation:

 {{{
 $ ./varnishtest -iv tests/b00038.vtc
 ...
 ***  v1    0.4 debug| Child (7885) died signal=6\n
 ***  v1    0.4 debug| Child (7885) Panic message:\n
 ***  v1    0.4 debug| Assert error in vsl_sanity(), cache/cache_shmlog.c
 line 60:\n
 ***  v1    0.4 debug|   Condition((vsl) != 0) not true.\n
 ***  v1    0.4 debug| thread = (cache-worker)\n
 ***  v1    0.4 debug| version = varnish-trunk revision 389c050\n
 ***  v1    0.4 debug| ident =
 Linux,3.14-2-amd64,x86_64,-smalloc,-smalloc,-hcritbit,epoll\n
 ***  v1    0.4 debug| Backtrace:\n
 ***  v1    0.4 debug|   0x44db69: pan_backtrace+0x19\n
 ***  v1    0.4 debug|   0x44da62: pan_ic+0x282\n
 ***  v1    0.4 debug|   0x45db3c: vsl_sanity+0x5c\n
 ***  v1    0.4 debug|   0x45eb97: VSLb+0x127\n
 ***  v1    0.4 debug|   0x49762d: STV_NewObject+0x46d\n
 ***  v1    0.4 debug|   0x458f73: cnt_synth+0x6a3\n
 ***  v1    0.4 debug|   0x4548c2: CNT_Request+0x752\n
 ***  v1    0.4 debug|   0x47d22a: HTTP1_Session+0x5aa\n
 ***  v1    0.4 debug|   0x45bcb0: ses_req_pool_task+0x210\n
 ***  v1    0.4 debug|   0x45b7b1: ses_sess_pool_task+0x261\n
 ***  v1    0.4 debug| req = 0x7f21f7c19020 {\n
 ***  v1    0.4 debug|   sp = 0x7f21f7c0e1e0, vxid = 1001,  step =
 R_STP_SYNTH,\n
 ***  v1    0.4 debug|   req_body = R_BODY_NONE,\n
 ***  v1    0.4 debug|   err_code = 503, err_reason = (null),\n
 ***  v1    0.4 debug|   restarts = 0, esi_level = 0\n
 ***  v1    0.4 debug|   sp = 0x7f21f7c0e1e0 {\n
 ***  v1    0.4 debug|     fd = 11, vxid = 1000,\n
 ***  v1    0.4 debug|     client = 127.0.0.1 60123,\n
 ***  v1    0.4 debug|     step = S_STP_WORKING,\n
 ***  v1    0.4 debug|   },\n
 ***  v1    0.4 debug|   worker = 0x7f22053dfc50 {\n
 ***  v1    0.4 debug|     stack = {0x7f22053e0000 -> 0x7f22053d4000}\n
 ***  v1    0.4 debug|     ws = 0x7f22053dfe68 {\n
 ***  v1    0.4 debug|       id = "wrk",\n
 ***  v1    0.4 debug|       {s,f,r,e} =
 {0x7f22053df400,0x7f22053df400,(nil),+2040},\n
 ***  v1    0.4 debug|     },\n
 ***  v1    0.4 debug|   VCL::method = SYNTH,\n
 ***  v1    0.4 debug|   VCL::return = deliver,\n
 ***  v1    0.4 debug|   VCL::methods = {RECV, HASH, MISS, SYNTH,
 BACKEND_FETCH},\n
 ***  v1    0.4 debug|   },\n
 ***  v1    0.4 debug|   ws = 0x7f21f7c191d0 {\n
 ***  v1    0.4 debug|     id = "req",\n
 ***  v1    0.4 debug|     {s,f,r,e} =
 {0x7f21f7c1aff0,+216,(nil),+57384},\n
 ***  v1    0.4 debug|   },\n
 ***  v1    0.4 debug|   http[req] = {\n
 ***  v1    0.4 debug|     ws = 0x7f21f7c191d0[req]\n
 ***  v1    0.4 debug|       "GET",\n
 ***  v1    0.4 debug|       "/",\n
 ***  v1    0.4 debug|       "HTTP/1.1",\n
 ***  v1    0.4 debug|       "X-Forwarded-For: 127.0.0.1",\n
 ***  v1    0.4 debug|   },\n
 ***  v1    0.4 debug|   http[resp] = {\n
 ***  v1    0.4 debug|     ws = 0x7f21f7c191d0[req]\n
 ***  v1    0.4 debug|       "HTTP/1.1",\n
 ***  v1    0.4 debug|       "503",\n
 ***  v1    0.4 debug|       "Service Unavailable",\n
 ***  v1    0.4 debug|       "Date: Wed, 29 Oct 2014 09:26:34 GMT",\n
 ***  v1    0.4 debug|       "Server: Varnish",\n
 ***  v1    0.4 debug|       "X-Varnish: 1001",\n
 ***  v1    0.4 debug|       "Content-Type: text/html; charset=utf-8",\n
 ***  v1    0.4 debug|       "Retry-After: 5",\n
 ***  v1    0.4 debug|   },\n
 ***  v1    0.4 debug|   vcl = {\n
 ***  v1    0.4 debug|     srcname = {\n
 ***  v1    0.4 debug|       "input",\n
 ***  v1    0.4 debug|       "Builtin",\n
 ***  v1    0.4 debug|     },\n
 ***  v1    0.4 debug|   },\n
 ***  v1    0.4 debug|   objcore (REQ) = 0x7f21f7c2a0c0 {\n
 ***  v1    0.4 debug|     refcnt = 1\n
 ***  v1    0.4 debug|     flags = 0x102\n
 ***  v1    0.4 debug|     objhead = 0x7f2202c69500\n
 ***  v1    0.4 debug|     stevedore = 0x7f2202c443c0 (malloc Transient)\n
 ***  v1    0.4 debug|   }\n
 ***  v1    0.4 debug| },\n
 ***  v1    0.4 debug| \n
 ***  v1    0.4 debug| \n
 ***  v1    0.4 debug| Child cleanup complete\n
 }}}

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



More information about the varnish-bugs mailing list