Comment 1 for bug 625551

Revision history for this message
John A Meinel (jameinel) wrote : Re: [Bug 625551] [NEW] selftest --parallel=subprocess ignores child stderr pipes

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 8/27/2010 4:14 PM, Martin [gz] wrote:
> Public bug reported:
>
> When running selftest with --parallel=subprocess (and actually having
> more than one CPU or BZR_CONCURRENCY set to > 1) Bazaar creates the
> child processes for running the tests with a stderr pipe, but then never
> does anything with with the process.stderr argument.
>
> # stderr=subprocess.STDOUT would be ideal, but until we prevent
> # noise on stderr it can interrupt the subunit protocol.
> process = subprocess.Popen(argv, stdin=subprocess.PIPE,
> stdout=subprocess.PIPE,
> stderr=subprocess.PIPE,
> bufsize=1)
>
> This is particularly bad as only stdout is ever read from before calling
> wait on the process, so if a child writes more than the OS pipe buffer
> size to stderr the process will hang.
>
> I don't quite understand the comment on the code above, as while subunit
> is used, it will always be impossible to write arbitrary stuff to stdout
> without breaking things.
>
> It appears that --parallel=fork leaves stderr on the same fd as the
> parent, so similarly removing the stderr argument above may be sifficent
> for now. It at least makes problems visible (though possibly
> intermingled) and prevents wedging.
>
> ** Affects: bzr
> Importance: Low
> Status: Confirmed
>
>

Seems reasonable to me. The other option is to use '.communicate'
instead of .wait(). Or possibly child.stderr.close() child.wait() since
that will avoid blocking at least.

John
=:->

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkx6mNoACgkQJdeBCYSNAAMHsACeMzJTdF2SyX8pU6nRd1S68M6S
+1MAoJjxg8VrbL84C2f+HlHblJP8wm3/
=o9jV
-----END PGP SIGNATURE-----