This small patch reloads dynamic libraries whose modification time is
greater than that at the time it was initially loaded. This means that
connections do not need to be reinitialised when a library is recompiled.

There is a problem with this, however: if dlopen()'ing the new patch
fails, the functions registered in the system against this patch will also
presumably break. This is, of course, what would happened if, a new
connection came in after the library was broken and it attempted to use
any of the functions in it.

Any ideas about ways around this? Need there be? Is this desired
behaviour?

Gavin
Sat, 4 May 2002 21:05:35 +1000 (EST)
Gavin Sherry <swm@linuxworld.com.au>
Auto-reload of dynamic libraries
Gavin Sherry <swm@linuxworld.com.au> writes:
> This small patch reloads dynamic libraries whose modification time is
> greater than that at the time it was initially loaded. This means that
> connections do not need to be reinitialised when a library is recompiled.

Is that a good idea?  It's easy to imagine cases where a library is not
designed to be unloaded (eg, it hooks into things in the main backend
and doesn't have a way to unhook).  I'd rather stick with the current
behavior of unload/reload only when specifically commanded to.

The patch as given fails in the same inode/different path case, btw.
I think you wanted to make the test further down.

			regards, tom lane

Sat, 04 May 2002 11:36:45 -0400
Tom Lane <tgl@sss.pgh.pa.us>
Re: [PATCHES] Auto-reload of dynamic libraries 