Updating VMODs with zero downtime

Poul-Henning Kamp phk at phk.freebsd.dk
Mon Aug 25 11:13:04 CEST 2014


--------
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 :-(

-- 
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.



More information about the varnish-misc mailing list