On Fri, Feb 4, 2022 at 12:30 PM Pablo Caballero <pdcv...@gmail.com> wrote:
>
> Errata
>
> Go is blocked trying to read from the channel (exec\exec.go):
>
> for range c.goroutine { if err := <-c.errch; err != nil && copyError == nil { 
> copyError = err } }
>
> I think that the problem happens if you specify an io.Writer as cmd.Stdout 
> and such writer doesn’t satisfy os.File (Output() uses a bytes.Buffer 
> internally) because in that case a Pipe is used (to copy data between the 
> writer/process). It seems like the pipe is inherited by the child process and 
> isn’t closed until the child finish (blocking the goroutine that reads from 
> the pipe and writes to the writer even if the parent process is gone).

For reference, this class of problems is https://go.dev/issue/23019.

Ian

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/CAOyqgcVJQKNjfsph3VVuxFq0CbFMf%2B9EAZHp44xy%3DnTTSvEjAA%40mail.gmail.com.

Reply via email to