Open
Description
subprocess.py when using _posixsubprocess.c has a pipe that it waits on to indicate that the child process exec
system call succeeded, or to report an error from the child up to including an exec
failure. Normally this is trivial and instant. But it is technically possible for a system to have other things going on that could lead this to take a while in unusual circumstances:
Line 1873 in 20cf32e
We should change this to a non-blocking read or poll call and have it support a timeout so that subprocess timeout support works in this scenario.
motivation: trying to debug an unusual process launching issue myself, and this user report: https://discuss.python.org/t/sporadic-hang-in-subprocess-run/26213.