[Varnish] #253: Patch to make use of default_grace

Varnish varnish-bugs at projects.linpro.no
Thu Jun 19 05:29:44 CEST 2008


#253: Patch to make use of default_grace
--------------------+-------------------------------------------------------
 Reporter:  sky     |       Owner:  des  
     Type:  defect  |      Status:  new  
 Priority:  normal  |   Milestone:       
Component:  build   |     Version:  trunk
 Severity:  normal  |    Keywords:       
--------------------+-------------------------------------------------------
 Currently, unless you set obj.grace, grace is set to NaN so the adding of
 the ttl to obj.grace results in another NaN. The object then timeouts
 within a second.

 This exposes HSH_Grace and calls it at the

 {{{
 Index: bin/varnishd/cache_expire.c
 ===================================================================
 --- bin/varnishd/cache_expire.c (revision 2735)
 +++ bin/varnishd/cache_expire.c (working copy)
 @@ -147,7 +147,7 @@
                 oe->timer_when = o->prefetch;
                 oe->timer_what = tmr_prefetch;
         } else {
 -               oe->timer_when = o->ttl + o->grace;
 +               oe->timer_when = o->ttl + HSH_Grace(o->grace);
                 oe->timer_what = tmr_ttl;
         }
  }
 Index: bin/varnishd/cache_hash.c
 ===================================================================
 --- bin/varnishd/cache_hash.c   (revision 2735)
 +++ bin/varnishd/cache_hash.c   (working copy)
 @@ -67,7 +67,7 @@

  static struct hash_slinger      *hash;

 -static double
 +double
  HSH_Grace(double g)
  {
         if (isnan(g))
 Index: bin/varnishd/cache.h
 ===================================================================
 --- bin/varnishd/cache.h        (revision 2735)
 +++ bin/varnishd/cache.h        (working copy)
 @@ -463,6 +463,7 @@
  void HSH_Ref(struct object *o);
  void HSH_Deref(struct object *o);
  void HSH_Init(void);
 +double HSH_Grace(double g);

  /* cache_http.c */
  const char *http_StatusMessage(unsigned);
 }}}

-- 
Ticket URL: <http://varnish.projects.linpro.no/ticket/253>
Varnish <http://varnish.projects.linpro.no/>
The Varnish HTTP Accelerator


More information about the varnish-bugs mailing list