-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
panic in exec #971
Comments
/lifecycle active |
Lines 75 to 76 in 7dd62cd
🤦♂ 🤦♂ |
Go's standard library has: // CombinedOutput runs the command and returns its combined standard
// output and standard error.
func (c *Cmd) CombinedOutput() ([]byte, error) {
if c.Stdout != nil {
return nil, errors.New("exec: Stdout already set")
}
if c.Stderr != nil {
return nil, errors.New("exec: Stderr already set")
}
var b bytes.Buffer
c.Stdout = &b
c.Stderr = &b
err := c.Run()
return b.Bytes(), err
} however, presumably this is a bit safer than a pair of MultiWriters. |
on the plus side, digging into what's going on here ... i think there's a good chance fixing this fixes #949 |
So if https://golang.org/src/os/exec/exec.go func (c *Cmd) stdout() (f *os.File, err error) {
return c.writerDescriptor(c.Stdout)
}
func (c *Cmd) stderr() (f *os.File, err error) {
if c.Stderr != nil && interfaceEqual(c.Stderr, c.Stdout) {
return c.childFiles[1], nil
}
return c.writerDescriptor(c.Stderr)
} This is why When we set up an In that case, we need to handle the writer receiving concurrent writes. |
Filed #972 with more details and a fix. |
This is a little tricky to intentionally reproduce, I believe #972 should prevent it, but we should keep our eyes peeled. |
kubernetes/kubernetes#84122 (comment)
/priority critical-urgent
/assign
The text was updated successfully, but these errors were encountered: