mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-31 23:37:01 +00:00
avoid blocking on full-pipe conditions for procs that write to stdout, which we continue to ignore
This commit is contained in:
parent
5174ca21f6
commit
df246991e0
@ -19,6 +19,7 @@ package tasks
|
||||
import (
|
||||
"fmt"
|
||||
"io"
|
||||
"io/ioutil"
|
||||
"os/exec"
|
||||
"sync"
|
||||
"sync/atomic"
|
||||
@ -218,10 +219,15 @@ func notStartedTask(t *Task) taskStateFn {
|
||||
|
||||
// create command
|
||||
cmd := exec.Command(t.bin, t.args...)
|
||||
if _, err := cmd.StdoutPipe(); err != nil {
|
||||
stdout, err := cmd.StdoutPipe()
|
||||
if err != nil {
|
||||
t.tryError(fmt.Errorf("error getting stdout of %v: %v", t.name, err))
|
||||
return taskShouldRestart
|
||||
}
|
||||
go func() {
|
||||
defer stdout.Close()
|
||||
io.Copy(ioutil.Discard, stdout) // TODO(jdef) we might want to save this at some point
|
||||
}()
|
||||
stderrLogs, err := cmd.StderrPipe()
|
||||
if err != nil {
|
||||
t.tryError(fmt.Errorf("error getting stderr of %v: %v", t.name, err))
|
||||
|
Loading…
Reference in New Issue
Block a user