<html><body><div style="color:#000; background-color:#fff; font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;font-size:10pt"><div class="" style="">Hello, </div><div class="" style=""><br class="" style=""></div><div style="color: rgb(0, 0, 0); font-size: 13px; font-family: HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-style: normal; background-color: transparent;" class="">We're using 3.0.5 in production and currently testing 4.0.1. </div><div style="color: rgb(0, 0, 0); font-size: 13px; font-family: HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-style: normal; background-color: transparent;" class=""><br class="" style=""></div><div style="color: rgb(0, 0, 0); font-size: 13px; font-family: HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-style: normal; background-color: transparent;" class="">We
have some urls for which we always construct synthetic responses. (/ping response pong)</div><div style="color: rgb(0, 0, 0); font-size: 13px; font-family: HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-style: normal; background-color: transparent;" class=""><br class="" style=""></div><div style="color: rgb(0, 0, 0); font-size: 13px; font-family: HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-style: normal; background-color: transparent;" class="">In 4.x vcl, I'm matching against the req url and returning synth with appropriate error code.</div><div style="color: rgb(0, 0, 0); font-size: 13px; font-family: HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-style: normal; background-color: transparent;" class=""><br class="" style=""></div><div style="color: rgb(0, 0, 0); font-size: 13px; font-family: HelveticaNeue, 'Helvetica Neue',
Helvetica, Arial, 'Lucida Grande', sans-serif; font-style: normal; background-color: transparent;" class="">>>>>>>>>>>>>>>></div><div style="color: rgb(0, 0, 0); font-size: 13px; font-family: HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-style: normal; background-color: transparent;" class=""><br class="" style=""></div><div style="background-color: transparent;" class="">sub vcl_recv {</div><div style="background-color: transparent;" class=""> if (req.url ~ "^/ping") {</div><div style="background-color: transparent;" class=""> return (synth(1002, "OK"));</div><div style="background-color: transparent;" class=""> }</div><div style="color: rgb(0, 0, 0); font-size: 13px; font-family: HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-style: normal; background-color: transparent;" class=""><br class=""
style=""></div><div style="color: rgb(0, 0, 0); font-size: 13px; font-family: HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-style: normal; background-color: transparent;" class=""><br class="" style=""></div><div style="background-color: transparent;" class="">sub vcl_synth {</div><div style="background-color: transparent;" class=""><br class="" style=""></div><div style="background-color: transparent;" class=""> if (resp.status == 1002) {</div><div style="background-color: transparent;" class=""> set resp.status = 200;</div><div style="background-color: transparent;" class=""> set resp.http.Content-Type = "text/plain; charset=utf-8";</div><div style="background-color: transparent;" class=""> synthetic("pong");</div><div style="background-color: transparent;" class=""> return (deliver);</div><div style="background-color: transparent;" class="">
}</div><div style="background-color: transparent;" class=""><br class="" style=""></div><div style="background-color: transparent;" class="">}</div><div style="background-color: transparent;" class=""><<<<<<<<<<<<<<<<<</div><div style="background-color: transparent;" class=""><br class="" style=""></div><div style="color: rgb(0, 0, 0); font-size: 13px; font-family: HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-style: normal; background-color: transparent;" class="">However, when the backend is down, varnish does not return the synthetic response</div><div style="color: rgb(0, 0, 0); font-size: 13px; font-family: HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-style: normal; background-color: transparent;" class=""><br class="" style=""></div><div style="color: rgb(0, 0, 0); font-size: 13px; font-family: HelveticaNeue, 'Helvetica
Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-style: normal; background-color: transparent;" class=""><br class="" style=""></div><div style="background-color: transparent;" class="">< HTTP/1.1 503 OK</div><div style="background-color: transparent;" class="">< Date: Wed, 10 Sep 2014 04:31:40 GMT</div><div style="background-color: transparent;" class="">< Server: Varnish</div><div style="background-color: transparent;" class="">< X-Varnish: 35</div><div style="background-color: transparent;" class="">< Content-Length: 0</div><div style="background-color: transparent;" class="">< Connection: keep-alive</div><div style="background-color: transparent;" class=""><br class="" style=""></div><div style="color: rgb(0, 0, 0); font-size: 13px; font-family: HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-style: normal; background-color: transparent;" class="">Here is the varnishlog</div><div
style="color: rgb(0, 0, 0); font-size: 13px; font-family: HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-style: normal; background-color: transparent;" class=""><br class="" style=""></div><div style="background-color: transparent;" class="">- ReqHeader Host: localhost:6081</div><div style="background-color: transparent;" class="">- ReqHeader Accept: */*</div><div style="background-color: transparent;" class="">- ReqHeader X-Forwarded-For: 127.0.0.1</div><div style="background-color: transparent;" class="">- VCL_call RECV</div><div style="background-color: transparent;" class="">- Debug "VCL_error(1002, OK)"</div><div style="background-color: transparent;" class="">- VCL_return synth</div><div style="background-color: transparent;" class="">-
VCL_call HASH</div><div style="background-color: transparent;" class="">- VCL_return lookup</div><div style="background-color: transparent;" class="">- Timestamp Process: 1410309978.983313 0.000075 0.000075</div><div style="background-color: transparent;" class="">- RespHeader Date: Wed, 10 Sep 2014 00:46:18 GMT</div><div style="background-color: transparent;" class="">- RespHeader Server: Varnish</div><div style="background-color: transparent;" class="">- RespHeader X-Varnish: 32797</div><div style="background-color: transparent;" class="">- RespProtocol HTTP/1.1</div><div style="background-color: transparent;" class="">- RespStatus 503</div><div style="background-color: transparent;" class="">- RespReason Service Unavailable</div><div style="background-color:
transparent;" class="">- RespReason OK</div><div style="background-color: transparent;" class="">- VCL_call SYNTH</div><div style="background-color: transparent;" class="">- VCL_return deliver</div><div style="background-color: transparent;" class="">- RespHeader Content-Length: 0</div><div style="background-color: transparent;" class=""><br class="" style=""></div><div style="color: rgb(0, 0, 0); font-size: 13px; font-family: HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-style: normal; background-color: transparent;" class=""><br class="" style=""></div><div style="color: rgb(0, 0, 0); font-size: 13px; font-family: HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-style: normal; background-color: transparent;" class="">Not sure why the thread would call HASH. I would expect varnish to
deliver the response after the vcl_synth call ?</div><div style="color: rgb(0, 0, 0); font-size: 13px; font-family: HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-style: normal; background-color: transparent;" class=""><br class="" style=""></div><div style="color: rgb(0, 0, 0); font-size: 13px; font-family: HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-style: normal; background-color: transparent;" class="">Is this the expected behavior ? How can I fix this to return synthetic response without regard for the health of the backend</div><div style="color: rgb(0, 0, 0); font-size: 13px; font-family: HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-style: normal; background-color: transparent;" class=""><br class="" style=""></div><div style="color: rgb(0, 0, 0); font-size: 13px; font-family: HelveticaNeue, 'Helvetica Neue', Helvetica, Arial,
'Lucida Grande', sans-serif; font-style: normal; background-color: transparent;" class="">appreciate your response !</div><div style="color: rgb(0, 0, 0); font-size: 13px; font-family: HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-style: normal; background-color: transparent;" class=""><br class="" style=""></div><div style="color: rgb(0, 0, 0); font-size: 13px; font-family: HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-style: normal; background-color: transparent;" class="">thank you,</div><div style="color: rgb(0, 0, 0); font-size: 13px; font-family: HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-style: normal; background-color: transparent;" class=""><br class="" style=""></div><div style="color: rgb(0, 0, 0); font-size: 13px; font-family: HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-style:
normal; background-color: transparent;" class="">Madhu</div><div style="color: rgb(0, 0, 0); font-size: 13px; font-family: HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-style: normal; background-color: transparent;" class=""><br class="" style=""></div><div style="color: rgb(0, 0, 0); font-size: 13px; font-family: HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-style: normal; background-color: transparent;" class="">ps: <span style="font-size: 10pt; background-color: transparent;" class="">Also looking forward to 4.x version of Varnish book </span></div><div class="" style=""><span style="font-size: 10pt; background-color: transparent;" class=""><br class="" style=""></span></div><div style="color: rgb(0, 0, 0); font-size: 13px; font-family: HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-style: normal; background-color:
transparent;" class=""><br class="" style=""></div><div style="color: rgb(0, 0, 0); font-size: 13px; font-family: HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-style: normal; background-color: transparent;" class=""><br class="" style=""></div></div></body></html>