[Distutils] Installing packages using pip

Marius Gedminas marius at gedmin.as
Mon Nov 16 11:25:03 EST 2015


On Mon, Nov 16, 2015 at 01:38:23PM +0000, Paul Moore wrote:
> I don't know what Unix does, I suspect it retains an old
> copy of the shared library for the process until the process exists,
> in which case you'd see a different issue, that you do an upgrade, but
> your process still uses the old code till you restart.

Basically.

Technically, both Linux and Windows won't let you write to a shared
library you have mapped into a process's address space for execution.
(You get an -ETEXT error on Linux, which one can observer if one tries
to re-create virtualenv while its bin/python is currently running.)

What you can do Linux that you cannot do on Windows is delete a shared
library file while it's mapped into a process's address space.  Then
Linux lets you create a new file with the same name, while the old file
stays around, nameless, until it's no longer used, at which point the
disk space gets garbage-collected.  (If we can call reference counting
"garbage collection".)

The result is as you said: existing processes keep running the old code
until you restart them.  There are tools (based on lsof, AFAIU) that
check for this situation and remind you to restart daemons.

Marius Gedminas
-- 
We like stress testing, because we know the future will be stressful.
        -- Maritza Mendez
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 173 bytes
Desc: Digital signature
URL: <http://mail.python.org/pipermail/distutils-sig/attachments/20151116/6dc5b44c/attachment.sig>


More information about the Distutils-SIG mailing list