[Varnish] #1493: fetch and synth are the same in vcl_purge

Varnish varnish-bugs at varnish-cache.org
Mon May 5 17:49:08 CEST 2014


#1493: fetch and synth are the same in vcl_purge
-------------------+----------------------
 Reporter:  xcir   |       Type:  defect
   Status:  new    |   Priority:  normal
Milestone:         |  Component:  varnishd
  Version:  4.0.0  |   Severity:  normal
 Keywords:         |
-------------------+----------------------
 Hi,
 In vcl_purge can set return(fetch).
 But, req->req_step set to fixed value R_STP_SYNTH at cnt_purge.
 It seems like fetch isn't enabled.

 in lib/libvcc/generate.py
 {{{
         ('purge',
                 "C",
                 ('synth', 'fetch',)
         ),
 }}}


 in cnt_purge(bin/varnishd/cache/cache_req_fsm.c)
 {{{
         VCL_purge_method(req->vcl, wrk, req, NULL, req->http->ws);
         req->req_step = R_STP_SYNTH;
         return (REQ_FSM_MORE);
 }}}

 return(fetch) //Is not fetch to backend.
 {{{
 *   << Request  >> 2
 -   Begin          req 1 rxreq
 -   Timestamp      Start: 1399304734.267941 0.000000 0.000000
 -   Timestamp      Req: 1399304734.267941 0.000000 0.000000
 -   ReqStart       192.168.1.199 43521
 -   ReqMethod      GET
 -   ReqURL         /rand.php
 -   ReqProtocol    HTTP/1.0
 -   ReqHeader      User-Agent: Wget/1.12 (linux-gnu)
 -   ReqHeader      Accept: */*
 -   ReqHeader      Host: 192.168.1.45
 -   ReqHeader      Connection: Keep-Alive
 -   ReqHeader      purge: 1
 -   ReqHeader      fetch: 1
 -   ReqHeader      X-Forwarded-For: 192.168.1.199
 -   VCL_call       RECV
 -   VCL_return     purge
 -   VCL_call       HASH
 -   VCL_return     lookup
 -   VCL_call       PURGE
 -   VCL_return     fetch
 -   Timestamp      Process: 1399304734.268233 0.000292 0.000292
 -   RespProtocol   HTTP/1.1
 -   RespStatus     501
 -   RespHeader     Date: Mon, 05 May 2014 15:45:34 GMT
 -   RespHeader     Server: Varnish
 -   RespHeader     X-Varnish: 2
 -   RespResponse   Not Implemented
 -   VCL_call       SYNTH
 -   RespHeader     Content-Type: text/html; charset=utf-8
 -   RespHeader     Retry-After: 5
 -   VCL_return     deliver
 -   RespHeader     Content-Length: 398
 -   Debug          "RES_MODE 2"
 -   RespHeader     Connection: keep-alive
 -   Timestamp      Resp: 1399304734.268498 0.000558 0.000266
 -   ReqAcct        138 0 138 201 398 599
 -   End
 }}}

 return(synth(200, "Purged"))
 {{{
 *   << Request  >> 32770
 -   Begin          req 32769 rxreq
 -   Timestamp      Start: 1399304835.110713 0.000000 0.000000
 -   Timestamp      Req: 1399304835.110713 0.000000 0.000000
 -   ReqStart       192.168.1.199 43522
 -   ReqMethod      GET
 -   ReqURL         /rand.php
 -   ReqProtocol    HTTP/1.0
 -   ReqHeader      User-Agent: Wget/1.12 (linux-gnu)
 -   ReqHeader      Accept: */*
 -   ReqHeader      Host: 192.168.1.45
 -   ReqHeader      Connection: Keep-Alive
 -   ReqHeader      purge: 1
 -   ReqHeader      X-Forwarded-For: 192.168.1.199
 -   VCL_call       RECV
 -   VCL_return     purge
 -   VCL_call       HASH
 -   VCL_return     lookup
 -   VCL_call       PURGE
 -   Debug          "VCL_error(200, Purged)"
 -   VCL_return     synth
 -   Timestamp      Process: 1399304835.110802 0.000089 0.000089
 -   RespProtocol   HTTP/1.1
 -   RespStatus     200
 -   RespHeader     Date: Mon, 05 May 2014 15:47:15 GMT
 -   RespHeader     Server: Varnish
 -   RespHeader     X-Varnish: 32770
 -   RespResponse   Purged
 -   VCL_call       SYNTH
 -   RespHeader     Content-Type: text/html; charset=utf-8
 -   RespHeader     Retry-After: 5
 -   VCL_return     deliver
 -   RespHeader     Content-Length: 375
 -   Debug          "RES_MODE 2"
 -   RespHeader     Connection: keep-alive
 -   RespHeader     Accept-Ranges: bytes
 -   Timestamp      Resp: 1399304835.110910 0.000197 0.000108
 -   ReqAcct        128 0 128 218 375 593
 -   End
 }}}

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



More information about the varnish-bugs mailing list