-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
(Linux) pid_exists() should return False if passed a TID #687
Comments
This may be due to process threads: /proc/947 refers to a thread opened by another process. |
I'm also hitting this problem. |
So yes, it turns hidden directories not appearing in
So the question is how to pre-emptively distinguish a process from a thread. Another possibility is to read |
It turns out checking
|
Got hit by this, because I am using psutil to check if the server process is still running when starting it (with the old pid coming from a pid file). So I get this:
Okay, what's the pid?
Err, okay, what's it doing?
|
OK, with 250e3a5 |
The test case:
This fails with:
...and happens both as root and an unprivileged user.
For some reason it seems
os.listdir('/proc')
won't list directory '947' butos.stat('947')
won't fail (directory exists) and hence alsopsutil.Process(947)
andpsutil.pid_exists(947)
succeed.ls /proc
also won't show directory 947 butls /proc/947
succeeds.Also
ps
doen't show pid 947.This is weird.
The text was updated successfully, but these errors were encountered: