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
Subprocess.wait_for_exit
never resolves if process terminated before it is called
#3364
Comments
As long as Tornado is the only thing that touches the SIGCHLD handler, the child process is guaranteed to exist (in a zombie state) until os.waitpid (or another wait function) is called on it once. Could something else be installing a SIGCHLD handler, ignoring SIGCHLD, or calling os.wait directly? (In this example it seems wrong to use both |
Ok, interesting! As far as I understand, nothing else is happening. We were creating the subprocess (calling However, we used the |
The
wait_for_exit
method eventually callsos.waitpid
, which throws aChildProcessError
if no process with the specified pid exists. This exception is caught, the function just returns, and theFuture
never resolves.tornado/tornado/process.py
Line 348 in 65a9e48
Instead, the process could be retrieved from the
_waiting
dict and the return code could be accessed from the object directly.The text was updated successfully, but these errors were encountered: