Fix for saintmode

Kristian Lyngstol kristian at varnish-software.com
Wed May 2 11:54:20 CEST 2012


Greetings,

PHK asked me to take a look at this and get back to you about it...
There seems to have been some history here I missed.

On Tue, Feb 21, 2012 at 01:10:17PM -0800, Artur Bergman wrote:
> Saintmode sadly locks on every request to vbe_healthy, this means if
> you do req.backend.healty you acquire the lock.
> 
> It does this even if the list is empty. Following patch fix this, it
> introduces a tiny race which I am happy to live with.
> 
> --- a/varnish-cache/bin/varnishd/cache_backend.c
> +++ b/varnish-cache/bin/varnishd/cache_backend.c
> @@ -266,7 +266,7 @@ vbe_Healthy(double now, uintptr_t target, struct backend *backend)
>                threshold = backend->saintmode_threshold;
> 
>        /* Saintmode is disabled */
> -       if (threshold == 0)
> +       if (threshold == 0 || VTAILQ_EMPTY(&backend->troublelist))
>                return (1);
> 
>        /* No need to test if we don't have an object head to test against.

This is already in master...

Not sure what this is about, but I sense a misunderstanding?

- Kristian




More information about the varnish-dev mailing list