Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Varnish: Dev

Fix for saintmode

 

 

Varnish dev RSS feed   Index | Next | Previous | View Threaded


artur at fastly

Feb 21, 2012, 1:10 PM

Post #1 of 3 (254 views)
Permalink
Fix for saintmode

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.

https://raw.github.com/gist/1878965/b1b31dd188d524e8f56b4700da34f2233b125578/saintmode-sane


--- 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.



_______________________________________________
varnish-dev mailing list
varnish-dev [at] varnish-cache
https://www.varnish-cache.org/lists/mailman/listinfo/varnish-dev


artur at fastly

Feb 21, 2012, 1:10 PM

Post #2 of 3 (246 views)
Permalink
Fix for saintmode [In reply to]

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.

https://raw.github.com/gist/1878965/b1b31dd188d524e8f56b4700da34f2233b125578/saintmode-sane


--- 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.



_______________________________________________
varnish-dev mailing list
varnish-dev [at] varnish-cache
https://www.varnish-cache.org/lists/mailman/listinfo/varnish-dev


kristian at varnish-software

May 2, 2012, 2:54 AM

Post #3 of 3 (187 views)
Permalink
Re: Fix for saintmode [In reply to]

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


_______________________________________________
varnish-dev mailing list
varnish-dev [at] varnish-cache
https://www.varnish-cache.org/lists/mailman/listinfo/varnish-dev

Varnish dev RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.