On 11/05/2014 08:07 PM, Brian C. Lane wrote:
On Tue, Nov 04, 2014 at 11:03:49AM -0500, David Shea wrote:
> Some system calls are interrupted by the receipt of a signal, for us
> most commonly a SIGCHLD caused by a process run from a different thread,
> which causes the call to return -1 and set errno to EINTR, which python
> converts into an OSError. Handle this by retrying the call.
What the heck? So basically system calls aren't thread-safe when using
subprocess in another thread? Seems like something that ought to be
fixed upstream.
Thanks for tracking this down.
I guess the argument is that if you're using os.* calls, you're trying
to get as close to the behavior of the C system calls as you can, and
that's part of it. It can be useful in some cases since you can do
blocking read/write calls with a SIGALRM timeout, but obviously there
also some pitfalls.