This appears to be because include/vcl_returns.h (varnish 2.0.1) asserts that deliver shouldnt' return error:<br><br>VCL_MET_MAC(deliver,DELIVER,(VCL_RET_RESTART|VCL_RET_DELIVER))<br><br>The documentation (man 7 vcl) indicates that error can be returned from vcl_deliver():<br>
<br>             The vcl_deliver subroutine may terminate with one of the following key-<br>             words:<br><br>             error code [reason]<br>                     Return the specified error code to the client and abandon the<br>
                     request.<br><br>             deliver<br>                     Deliver the object to the client.<br><br>It looks from the revision history that the change took place between r2341 and 4 and r3047.  It appears to be a deliberate change because vcl_error() calls vcl_deliver().  So it appears there is a documentation bug, not a code bug.  >)<br>
<br>What I'm really interested in doing is forcing a document into cache without having that document delivered.  I'm attempting to do this by defining a URL pattern to hint to varnish to fetch a document with a specific hash (i.e. not a hash specific to the particular request).  vcl_hash() knows what to do and is working properly.  vcl_fetch() knows what's going on and sets the infamous magic marker to tell vcl_deliver() what's up.<br>
<br>I had thought that I could just then tell vcl_deliver() to generate an "error" with HTTP status code of 200 and bogus content and avoid having the actual cached document returned.  This, however, seems not to be the case.<br>
<br>Am I overlooking a much simpler way to accomplish my goal?<br><br>Thanks,<br><br>Nato<br><br><div class="gmail_quote">On Wed, Nov 12, 2008 at 10:34 PM, Nathan Uno <span dir="ltr"><<a href="mailto:nigel_varnish@unos.net">nigel_varnish@unos.net</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">If I call error from vcl_deliver varnishd appears to die.  For example, the following (nonsensical) definition:<br>
<br>sub vcl_deliver {<br>    error 503 "Badness";<br>}<br><br>... results in the following varnishlog output (which looks like a crash to me):<br>
<br>   10 SessionOpen  c <a href="http://172.18.26.105" target="_blank">172.18.26.105</a> 47478 :8081<br>   10 ReqStart     c <a href="http://172.18.26.105" target="_blank">172.18.26.105</a> 47478 1731927449<br>   10 RxRequest    c GET<br>
   10 RxURL        c /PRIME/mtproxy/mtdata/14/2608/5704/1024<br>
   10 RxProtocol   c HTTP/1.1<br>   10 RxHeader     c Accept-Encoding: identity<br>   10 RxHeader     c Host: <a href="http://172.18.26.105:8081" target="_blank">172.18.26.105:8081</a><br>   10 RxHeader     c Connection: close<br>
   10 RxHeader     c User-agent: Python-urllib/2.4<br>
   10 VCL_call     c recv<br>   10 VCL_return   c lookup<br>   10 VCL_call     c hash<br>   10 VCL_return   c hash<br>   10 VCL_call     c miss<br>   10 VCL_return   c fetch<br>   12 BackendOpen  b default <a href="http://127.0.0.1" target="_blank">127.0.0.1</a> 60316 <a href="http://127.0.0.1" target="_blank">127.0.0.1</a> 8880<br>

   10 Backend      c 12 default default<br>   12 TxRequest    b GET<br>   12 TxURL        b /PRIME/mtproxy/mtdata/14/2608/5704/1024<br>   12 TxProtocol   b HTTP/1.1<br>   12 TxHeader     b Accept-Encoding: identity<br>   12 TxHeader     b Host: <a href="http://172.18.26.105:8081" target="_blank">172.18.26.105:8081</a><br>

   12 TxHeader     b User-agent: Python-urllib/2.4<br>   12 TxHeader     b X-Varnish: 1731927449<br>   12 TxHeader     b X-Forwarded-For: <a href="http://172.18.26.105" target="_blank">172.18.26.105</a><br>    0 CLI          - Rd vcl.load boot ./<a href="http://vcl.1P9zoqAU.so" target="_blank">vcl.1P9zoqAU.so</a><br>

    0 CLI          - Wr 0 200 Loaded "./<a href="http://vcl.1P9zoqAU.so" target="_blank">vcl.1P9zoqAU.so</a>" as "boot"<br>    0 CLI          - Rd vcl.use boot<br>    0 CLI          - Wr 0 200 <br>    0 CLI          - Rd start<br>

    0 Debug        - "Acceptor is epoll"<br>    0 CLI          - Wr 0 200 <br>    0 WorkThread   - 0x4485ec10 start<br>    0 WorkThread   - 0x4525fc10 start<br>    0 WorkThread   - 0x45c60c10 start<br>    0 WorkThread   - 0x46661c10 start<br>

    0 WorkThread   - 0x47062c10 start<br>    0 WorkThread   - 0x47a63c10 start<br>    0 WorkThread   - 0x48464c10 start<br>    0 WorkThread   - 0x48e65c10 start<br>    0 WorkThread   - 0x49866c10 start<br>    0 WorkThread   - 0x4a267c10 start<br>

<br>
</blockquote></div><br>