1. 22 Jan, 2016 12 commits
    • Lasse Karstensen's avatar
      Add the last set of changes. · 876f5419
      Lasse Karstensen authored
      876f5419
    • Federico G. Schwindt's avatar
      Use the right variable · 2806edf3
      Federico G. Schwindt authored
      Fixes previous commit. Sigh.
      2806edf3
    • Federico G. Schwindt's avatar
      Handle whitespace after floats in test fields · 152dd84a
      Federico G. Schwindt authored
      Broken in 9bb8f962.
      Committed solution proposed by phk@, discussed with phk@ and martin@.
      
      Fixes #1845.
      152dd84a
    • Poul-Henning Kamp's avatar
      Minor flexelinting · c371fe88
      Poul-Henning Kamp authored
      c371fe88
    • Poul-Henning Kamp's avatar
      Pass the type of VCL method (B(ackend)/C(lient)/H(ousekeeping) · 681da739
      Poul-Henning Kamp authored
      into the macro-table.
      681da739
    • Dridi Boukelmoune's avatar
      Replace the VCL refcount by a self-desribing list · 15897007
      Dridi Boukelmoune authored
      Instead of counting the references, the VCL keeps track of them with up
      to 31 characters in the description. It is the VMOD's responsibility to
      keep track of the opaque struct vclref * and provide a meaningful user-
      friendly description.
      15897007
    • Dridi Boukelmoune's avatar
      Simplify `vcl.use` by making it failsafe · 88e4ad90
      Dridi Boukelmoune authored
      By the time we decide to switch to a VCL, it must be warm and usable.
      The deprecated VCL_EVENT_USE should not get in the way.
      88e4ad90
    • Dridi Boukelmoune's avatar
      Catch a vcl.state failure on the manager side · 8dd463a3
      Dridi Boukelmoune authored
      Don't update the state of the VCL to warm if it failed, and don't start
      the child if the active VCL failed to warm up.
      8dd463a3
    • Dridi Boukelmoune's avatar
      Make VMODs actually fail warm-ups · fcd4a308
      Dridi Boukelmoune authored
      The implementation is similar to the load/discard dance when a load
      fails. New VGC functions are introduced iff the VCL has at least one
      VMOD handling events.
      
      The generated code looks like this:
      
      	static unsigned vgc_inistep;
      	static unsigned vgc_warmupstep;
      
      	...
      
      	static int
      	VGC_Load(VRT_CTX)
      	{
      		...
      	}
      
      	static int
      	VGC_Discard(VRT_CTX)
      	{
      		...
      	}
      
      	static int
      	VGC_Warmup(VRT_CTX, enum vcl_event_e ev)
      	{
      
      		vgc_warmupstep = 0;
      
      		/* 4 */
      		if (Vmod_debug_Func._event(ctx, &vmod_priv_debug, ev))
      			return (1);
      		vgc_warmupstep = 4;
      
      		return (0);
      	}
      
      	static int
      	VGC_Use(VRT_CTX, enum vcl_event_e ev)
      	{
      
      		/* 4 */
      		if (Vmod_debug_Func._event(ctx, &vmod_priv_debug, ev))
      			return (1);
      
      		return (0);
      	}
      
      	static int
      	VGC_Cooldown(VRT_CTX, enum vcl_event_e ev)
      	{
      		int retval = 0;
      
      		/* 4 */
      		if (vgc_warmupstep >= 4 &&
      		    Vmod_debug_Func._event(ctx, &vmod_priv_debug, ev) != 0)
      			retval = 1;
      
      		return (retval);
      	}
      
      	static int
      	VGC_Event(VRT_CTX, enum vcl_event_e ev)
      	{
      		if (ev == VCL_EVENT_LOAD)
      			return(VGC_Load(ctx));
      		if (ev == VCL_EVENT_WARM)
      			return(VGC_Warmup(ctx, ev));
      		if (ev == VCL_EVENT_USE)
      			return(VGC_Use(ctx, ev));
      		if (ev == VCL_EVENT_COLD)
      			return(VGC_Cooldown(ctx, ev));
      		if (ev == VCL_EVENT_DISCARD)
      			return(VGC_Discard(ctx));
      
      		return (1);
      	}
      
      However, if there are no VMODs handling events, no new functions shall
      be generated, leading to code looking like this:
      
      	static unsigned vgc_inistep;
      	static unsigned vgc_warmupstep;
      
      	...
      
      	static int
      	VGC_Load(VRT_CTX)
      	{
      		...
      	}
      
      	static int
      	VGC_Discard(VRT_CTX)
      	{
      		...
      	}
      
      	static int
      	VGC_Event(VRT_CTX, enum vcl_event_e ev)
      	{
      		if (ev == VCL_EVENT_LOAD)
      			return(VGC_Load(ctx));
      		if (ev == VCL_EVENT_DISCARD)
      			return(VGC_Discard(ctx));
      
      		(void)vgc_warmupstep;
      		return (0);
      	}
      fcd4a308
    • Dridi Boukelmoune's avatar
      Allow VMODs to fail a warm-up · 3c2d14c6
      Dridi Boukelmoune authored
      It is also possible to convey a message to the CLI. In case of a failure
      the VCL is cooled down. VCL_Load may now fail with either CLIS_PARAM or
      CLIS_CANT.
      3c2d14c6
    • Dridi Boukelmoune's avatar
      Wrap VCL event calls in dedicated functions · 37abc301
      Dridi Boukelmoune authored
      The two functions are separated in order to have self-documenting
      signatures because one class of events is (or will be) allowed to
      fail while the other MUST be failsafe.
      37abc301
    • Dridi Boukelmoune's avatar
      Turn VCL state magic numbers into an enum · 83e5fc59
      Dridi Boukelmoune authored
      Make a clear distinction between (struct vclprog).warm that is used as a
      boolean, unlike the second parameter of mgt_vcl_setstate. We don't use
      an actual C enum but const char[] to make debugging easier.
      83e5fc59
  2. 21 Jan, 2016 2 commits
  3. 20 Jan, 2016 1 commit
  4. 19 Jan, 2016 1 commit
  5. 18 Jan, 2016 6 commits
  6. 15 Jan, 2016 2 commits
    • Lasse Karstensen's avatar
      1fd0d394
    • Poul-Henning Kamp's avatar
      Add a final backstop, so we absolutely 100% certainly do not · 32af38d4
      Poul-Henning Kamp authored
      try to delete a objhead while it still has a waiting list,
      by forcing the last ref holder to rush the WL.
      
      Since the hasher owns the refcounts on objhead, we cannot just
      mingle req and objcore refcounts.
      
      Fortunately we don't need to add another refcounter, because all
      we really care about is the wl being empty when we drop the last
      ref.
      
      The wl/hsh_rush() mechanism will work differently with different
      thread-scheduling schenarios, and I cannot definitively rule out
      that we can drop the last ref on an oh, while there are still req's
      on the waiting list.
      
      Given that, and the existence proof in ticket #1823's race, this
      might have been the indicated memory-trampler.
      
      Conflicts:
      	bin/varnishd/cache/cache_hash.c
      32af38d4
  7. 14 Jan, 2016 16 commits