[PATCH] add documentation about backend naming for VMOD authors
geoff at uplex.de
Tue Nov 3 12:04:23 CET 2015
-----BEGIN PGP SIGNED MESSAGE-----
On 11/03/2015 09:27 AM, Dridi Boukelmoune wrote:
> I just realized that a VCL_HasBackend (or VRT) function for VMODs
> to "ensure" uniqueness would be racy by nature.
Yep, classic TOCTOU race. In addition to the fact that, if we do have
it, it should lock the mutex on the VCL's backend_list (which I
neglected in the patch).
So for a reliable solution, it looks like there's no way around
> Why not keep VRT_new_backend as the only interface for VMODs and
> allow this one to fail? (or do the atomic auto-renaming if needed)
Um, VRT_new_backend creates a conventional backend (HTTP over TCP)
from a vrt_backend config. What if you want to do something entirely
> After a quick glance at the thread again, it seems that non-VCL
> backends such as for instance unix-domain socket backend should
> eventually show up in the CLI and VSM. While I have nothing
> against that (quite the opposite) I don't think it can be done
> without breaking both ABI and API. The current statistics should be
> generic enough to suit any kind of backend, except maybe for the
> probe part.
A non-HTTP/TCP backend would have to update the stats itself, but at
least VRT_Register() can ensure that they are created. Which is good,
because you really need an arcane understanding of VSM to get that right.
> The varnish-cli on the other end is too struct backend-centric,
> and despite my attempt to restrict the director API to the bare
> minimum, cache_backend.h made it in 4.1 and cache_director.h wasn't
> stripped off of the VDI_ functions.
Really? Didn't know that. So if a VMOD creates a non-stuct-backend
backend, it gets no support in the CLI at all?
> I have the feeling that Geoff started a 4.1 thread and that we are
> also discussing things that belong post-4.1.
Sorry about that. %^)
I was just trying to get started on a backend VMOD one fine day, then
wondered what happens if a name gets duplicated, and then, well ...
** * * UPLEX - Nils Goroll Systemoptimierung
Tel +49 40 2880 5731
Mob +49 176 636 90917
Fax +49 40 42949753
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1
-----END PGP SIGNATURE-----
More information about the varnish-dev