Hi I'm revisiting this old thread. To be a bit more concrete and less hand-wavy this time around, here's a VMOD: https://github.com/daghf/libvmod-saintmode
Recent changes in Varnish have made things quite a bit simpler, in particular having bo->digest available (6b388a21), as well as having bo->director_resp (9ba9a8bb). That said, the issue that was brought up in my original email still stands, I still do need the digest to be available in vdir->healthy(). The github repo above includes a patch[1] that adds a busyobj parameter to vdir->healthy(). This permits the saintmode director access to the digest and thus lets us consider if that object is present on the saintmode trouble list. In the case that busyobj is not available in the calling context (i.e. on the client side), a NULL will be passed. In that case, the saintmode VMOD will merely fall back to returning the health status of the decorated backend. This is much like how it worked in 3.0, where the digest was zeroed and thus never found on the saintmode trouble list prior to executing vcl_hash. [1]: https://raw.githubusercontent.com/daghf/libvmod-saintmode/master/0001-Add-a-struct-busyobj-param-to-dir-healthy.patch (never mind that this patch says PATCH 1/3, the other two needed were varnish commits 9ec96da and 03a5a8d) Regards, Dag On Mon, May 26, 2014 at 11:04 AM, Poul-Henning Kamp <[email protected]> wrote: > In message > <CAEh05VZpyTZq2pT5dAnmwEc5AZLurAfxSeznQ4BsWxWa=ie...@mail.gmail.com> > , Dag Haavi Finstad writes: > >>The way I envisioned it is purely on the fetch side. So 'saintmode' in >>this case will be a tool that helps us avoid picking a backend for >>certain URLs. > > So how exactly does that work ? > > Once you havn't picked the backend, what backend do you then use ? > > Does the saint director pick another one ? (by what algorithm ?) > > -- > Poul-Henning Kamp | UNIX since Zilog Zeus 3.20 > [email protected] | TCP/IP since RFC 956 > FreeBSD committer | BSD since 4.3-tahoe > Never attribute to malice what can adequately be explained by incompetence. -- Dag Haavi Finstad Software Developer | Varnish Software Mobile: +47 476 64 134 We Make Websites Fly! _______________________________________________ varnish-dev mailing list [email protected] https://www.varnish-cache.org/lists/mailman/listinfo/varnish-dev
