Message10824

Author cwicklow
Recipients cwicklow
Date 2016-03-18.17:31:40
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1458322301.76.0.19069077096.issue2488@psf.upfronthosting.co.za>
In-reply-to
Content
In subprocess.py ...

If a caller is using poll(), and the poll() sets returncode != None, then a subsequent call to wait() will never join the coupler threads.

In the case that the executing process is redirecting output to files (particularly if the process is expected to generate large amounts of output), the coupler threads may not yet be complete. But a call to wait will not attempt to join the coupler threads (since the prior call to poll may have already stored the returncode), even if they are still purging I/O.

At that point, the caller cannot be certain that the output buffers are flushed (i.e. wait returns, giving the impression that the process is complete, but the I/O may still be being flushed), and has no way to know what that is complete (because wait will not block on the coupler threads if a prior call to poll has already determined that the process is complete).

A minor change in whitespace seems to resolve it (see https://github.com/jythontools/jython/pull/37).
History
Date User Action Args
2016-03-18 17:31:41cwicklowsetmessageid: <1458322301.76.0.19069077096.issue2488@psf.upfronthosting.co.za>
2016-03-18 17:31:41cwicklowsetrecipients: + cwicklow
2016-03-18 17:31:41cwicklowlinkissue2488 messages
2016-03-18 17:31:40cwicklowcreate