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

Hang caused by circus and psutil using conflicting methods to identify a process #1171

Open
TonyMay71 opened this issue Dec 10, 2021 · 0 comments

Comments

@TonyMay71
Copy link

resulting_pid, status = os.waitpid(pid, os.WNOHANG)

psutil uses a combination of PID and process creation time to identify a process. This means that an attempt to terminate a process by circus can fail if psutil notices that the creation times do not match. In this case psutil does not send a terminate signal to the process, but instead returns a NoSuchProcess exception.

The loop in watcher.reap_process() just uses the PID to identify a process. This means that the loop containing os.waitpid(pid, os.WNOHANG) can run forever as it waits for a process to terminate that has not been told to terminate.

Although the probability of this event occurring may seem small, this problem can be triggered by the psutil bug described in giampaolo/psutil#2031

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

No branches or pull requests

1 participant