Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
giampaolo opened this issue May 23, 2014 · 3 comments
Closed
Assignees

Comments

@giampaolo
Copy link
Owner

From g.rodola on June 19, 2012 20:16:08

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. 
https://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: http://code.google.com/p/psutil/issues/detail?id=286

@giampaolo giampaolo self-assigned this May 23, 2014
@giampaolo
Copy link
Owner Author

From g.rodola on June 19, 2012 11:31:25

Fixed in r1354 .

Status: FixedInSVN

@giampaolo
Copy link
Owner Author

From g.rodola on June 27, 2012 11:54:03

0.5.0 is finally out. Closing out as fixed.

Status: Fixed

@giampaolo
Copy link
Owner Author

From g.rodola on March 02, 2013 04:09:26

Updated csets after the SVN -> Mercurial migration: r1354 == revision ???

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant