[Varnish] #1553: Assert error in VRY_Prep(), cache/cache_vary.c line 228

Varnish varnish-bugs at varnish-cache.org
Wed Jul 23 15:37:04 CEST 2014


#1553: Assert error in VRY_Prep(), cache/cache_vary.c line 228
----------------------------+----------------------
 Reporter:  esfourteen      |       Type:  defect
   Status:  new             |   Priority:  normal
Milestone:                  |  Component:  varnishd
  Version:  4.0.1           |   Severity:  normal
 Keywords:  panic vry_prep  |
----------------------------+----------------------
 I'm using the vsthrottle vmod written by daghf (https://github.com/daghf
 /libvmod-vsthrottle), im using this in vcl_miss to stop people from
 hitting my backend servers when they request too often:

 {{{
 sub vcl_miss {
     if (req.url ~ "track_history/channel") {
         # per client check
         if(vsthrottle.is_denied("api:track_history:channel:ip:" +
 client.ip, 4, 10s)) {
             return (synth(429));
         }

         # global check
         if(vsthrottle.is_denied("api:track_history:channel", 75, 3s)) {
             return (synth(429));
         }
     }
 }
 }}}

 This will randomly cause a panic in the child, attached here:
 https://gist.github.com/esfourteen/88de06e0ce2335061c19

 This seems to be suggesting to do some Vary checks for caching, which is
 confusing because:

 * I don't send a Vary header from my backend
 * this is hitting vcl_miss which should indicate its determined there is
 no viable cached response
 * the panic shows the response already set, but the step indicates its
 doing a lookup?

 If I move the vsthrottle check to vcl_backend_fetch and return (abort)
 instead of synth, it never panics:

 {{{
 sub vcl_backend_fetch {
     if (bereq.url ~ "track_history/channel") {
         if(vsthrottle.is_denied("api:track_history:channel:ip:" +
 client.ip, 4, 10s)) {
             return (abandon);
         }
         if(vsthrottle.is_denied("api:track_history:channel", 75, 3s)) {
             return (abandon);
         }
     }
 }
 }}}

 So while the above does work, my clients are receiving a 503 error instead
 of the 429 which is what I need ideally.

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



More information about the varnish-bugs mailing list