Saint mode

Kristian Lyngstol kristian at redpill-linpro.com
Wed Dec 2 13:04:29 CET 2009


Hi Anders,

On Wed, Nov 18, 2009 at 02:52:39PM +0100, Anders Nordby wrote:
> We spoke briefly about in the Varnish meeting. Unfortunately I can not
> remember the conclusion(s), so I ask again:
> 
> 1) How to check in vcl_recv if a request was restarted saintmode? You
> mentioned something about checking TTL? Does it matter if that request
> is handled with pass or lookup? I want to avoid mixing up restarts due
> to saint mode and restarts due to what should have been normal passes in
> vcl_fetch (IMO) but which are restarts to handle it in vcl_recv to avoid
> "hit for pass" problems.

In vcl_recv we don't have a ttl, so you can't specifically check. You could
do something simple like:

sub vcl_fetch {
	....
	
	if (beresp.status != 200) {
		set req.http.X-Saint-restart = 1;
		set beresp.saintmode = 1m;
		restart;
	}
	...
}

That way you can easily check in recv. It's not perfect, but unless we have
the TTL, that's the only way.

In vcl_hit you can check if obj.ttl is negative, if it is, then you are
using a graced object.

> 2) How do use saint mode when backend fails to respond, covering
> everything from no response/connection to backend just resetting the
> connection? As far as my syslogging shows, connection failures are adressed
> in vcl_error and easy/possible to catch in vcl_fetch?

That's an excellent question. Implementation-wise saint-mode can handle
this, but we loose a bit too much information before we reach vcl_error, it
seems.

Saint-mode uses both the backend and the objecthead(reference) to work, and
we detach it a bit too soon.

PHK: Do you have any idea how to solve this? We've talked about making more
information available in vcl_error before, or just using vcl_fetch...

> Cheers from Gyoda, Saitama, Japan.

Cheers :) Just finished 2.5 weeks of various forms of training and
traveling myself, trying to catch up on mail and whatnot. Apologies for the
somewhat delayed response.

-- 
Kristian Lyngstøl
Redpill Linpro AS
Tlf: +47 21544179
Mob: +47 99014497
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 835 bytes
Desc: not available
URL: <https://www.varnish-cache.org/lists/pipermail/varnish-misc/attachments/20091202/c3c0ac6d/attachment-0003.pgp>


More information about the varnish-misc mailing list