Updating VMODs with zero downtime

Dridi Boukelmoune dridi.boukelmoune at zenika.com
Mon Aug 25 11:15:25 CEST 2014


On Mon, Aug 25, 2014 at 5:13 AM, Poul-Henning Kamp <phk at phk.freebsd.dk> wrote:
> --------
> In message <75602.1408955992 at critter.freebsd.dk>, "Poul-Henning Kamp" writes:
>>--------
>>In message <C3F5B55B-D63A-4D60-BF17-5B5F7A00D720 at gmail.com>, Carlos Abalde writ
>>es:
>>
>>>> So one murky bit here is if your OS's dlopen(3) implementation discovers
>>>> that the file has changed.  It sounds like it doesn't, and just reuses
>>>> the old already loaded copy :-(
>>>>
>>>> The surefire way to fix that is to append a version number to the
>>>> vmod filename, but it's kind of ugly...
>>>
>>>Hi,
>>>
>>>I've been checking the sources of Varnish and doing some more testing,
>>>and, as you suggest, this definitely seems related to dlopen(3) /
>>>dlclose(3) and how they are used when reloading Varnish.
>>
>>I have changed the vmod management code in -trunk to stat the compiled
>>vmod and check the st_dev/st_ino fields against the previously opened
>>vmods and to use fdlopen(3) to bypass the dlopen(3) name check.
>>
>>Hope this helps.
>
> Well, just learned that Linux doesn't have fldopen(3) like FreeBSD does,
> I'll have to revert this change :-(

What about some cpp macros to enable it on relevant platforms?

> --
> Poul-Henning Kamp       | UNIX since Zilog Zeus 3.20
> phk at FreeBSD.ORG         | TCP/IP since RFC 956
> FreeBSD committer       | BSD since 4.3-tahoe
> Never attribute to malice what can adequately be explained by incompetence.
>
> _______________________________________________
> varnish-misc mailing list
> varnish-misc at varnish-cache.org
> https://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc



More information about the varnish-misc mailing list