PFZheng / psutil

Automatically exported from code.google.com/p/psutil
Other
0 stars 0 forks source link

Process.is_running() doesn't actually check whether PID has been reused #286

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
The doc states:

> Return whether the current process is running in 
> the current process list. This is reliable also in 
> case the process is gone and its PID reused, 
> therefore it must be preferred over doing 
> psutil.pid_exists(p.pid).

After a look at how this is done I realized that the logic we're using to 
ensure the PID has not been reused is broken.

http://code.google.com/p/psutil/source/browse/tags/release-0.4.1/psutil/__init__
.py#412
What we're doing here is just requesting the creation time for the same PID 
(not sure why I made such a naive mistake and never realized it thus far). 
Instead, process creation time should be stored when the class is instantiated.

Original issue reported on code.google.com by g.rodola on 19 Jun 2012 at 6:16

GoogleCodeExporter commented 8 years ago
Fixed in r1354.

Original comment by g.rodola on 19 Jun 2012 at 6:31

GoogleCodeExporter commented 8 years ago
0.5.0 is finally out. Closing out as fixed.

Original comment by g.rodola on 27 Jun 2012 at 6:54

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
Updated csets after the SVN -> Mercurial migration:
r1354 == revision ???

Original comment by g.rodola on 2 Mar 2013 at 12:09