-
-
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
wait() function could throw TimeoutExpired exception when it shouldn't #1224
Comments
Mmmm, can you paste the traceback? |
This is our code snippet that calls psutil:
This is the log got:
Please see the log timestamp, they happened roughly within .1 second. This is on Windows platform. I tried to terminate notepad.exe and wait, and failed to repro. So it maybe it is harder to repro when terminating a light-weight process. This is just speculation though. |
I briefly investigated this. It may be due to |
Bumping up priority.
I know it doesn't happen all the time but... any chance you could provide a test script which reproduce it sometimes? |
I've created a simple script that could repro the issue occasionally. Originally I said the issue happens quite often. This assertion seems to be corrected. We ran tests in parallel on lots of machines, that increase the repro rate a lot. And the process we kill may also play a factor. Please run the script multiple times if needed. |
OK, I think I fixed this in #1253 but unfortunately I cannot reproduce the issue. Can you try? If you don't have a C compiler setup just tell me what Python version you have and I can attach a wheel file for you to try. |
Wheel for python 2.7 64bit: |
I'm assuming this is fixed. |
This issue is about function wait()
psutil/psutil/_pswindows.py
Line 791 in dd19ba7
My test scenario is listed below, although it doesn't repro 100%, it happens quite often. I didn't measure how frequently it happens though.
Speculation:
This behavior is different from the previous version. In the previous version, wait() will not throw TimeoutExpired, but just return the value returned from proc_wait().
The text was updated successfully, but these errors were encountered: