avoid freeze when capturing external stderr (#6700)

* avoid freeze when capturing external stderr

* try replace from sh to bash

* change description

* fmt code
This commit is contained in:
WindSoilder
2022-10-12 21:41:20 +08:00
committed by GitHub
parent 0bbb3a20df
commit 5815f122ed
5 changed files with 130 additions and 22 deletions

View File

@ -433,10 +433,14 @@ impl PipelineData {
if let PipelineData::ExternalStream {
stdout: stream,
stderr: stderr_stream,
exit_code,
..
} = self
{
// NOTE: currently we don't need anything from stderr
// so directly consumes `stderr_stream` to make sure that everything is done.
let _ = stderr_stream.map(|x| x.into_bytes());
if let Some(stream) = stream {
for s in stream {
let s_live = s?;