-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256 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 VRT_Register(). > 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 different? > 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 ... Best, Geoff - -- ** * * UPLEX - Nils Goroll Systemoptimierung Scheffelstraße 32 22301 Hamburg Tel +49 40 2880 5731 Mob +49 176 636 90917 Fax +49 40 42949753 http://uplex.de -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBCAAGBQJWOJSsAAoJEOUwvh9pJNUR8MQP/1lml8o7/vi+h92YUBB8Tlsu aYMn1DCyLWmRXJj4fL3/Xeupo9wzwbmCRgOgBSagR13jaYok/oY1cxU8qD44zYBf V30xcUlImLvlV3/Eso8atLlHrMAQwkuZlzybFh2Fk9QrZFX5HoQpUdojJ7ar7/Kw 0yMfUVs7EMD0U1SGRkl35zbis6bgJOF1VwQwBAJRIDQkrZRrPS5kFrdKlVjnGR9m lvdPKBq6GWGCPbEAVEw27eTV544ZqICO0/yzXWQ5pyG4SxQsRBRClsoSxr4C4l1X 3cV1fyzfki3nShOn3HZ6kp/GqeiEZe7k/fHj2fOEk/Os2Z/JMIRb/CwsNCgnJbUv GK1yNFmwD2AY1dmIF3cVlu17q5oV9tQsezrBYz7JSNHbLa2hA9bxZONFJQ1zv2eK gjFzfgDImyzZt5YBRWAIyJ5lP9dS9e6oym0fjXH8tnslfneNp5rokUkYJJNCGdAb GgYAXri6dH7gdJrb1qt6x9KiewzQ5cAiB6WKQGpJRRu1UXj3VWjpKMH2GdteD4PV 54PjpXxBrACEe9z5j3HbI+zaLyuGMyYPk6thOQI75MV5K/WISPfDl/idmc3ncgAm V/lFntYbgwgRJYjLOSk+QXjlcDxDC91dgkHdj/HpDnU0e5voxtJVhOz2i/MDngsg oNj0UCiE65TOfB+Txaa8 =pNwT -----END PGP SIGNATURE----- _______________________________________________ varnish-dev mailing list [email protected] https://www.varnish-cache.org/lists/mailman/listinfo/varnish-dev
