You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was working with spawning a lot of processes that didn't exist from a number of
goroutines. For these processes I was opening pipes for stdin, stdout and stderr. After
some point my process always got errors like "pipe: too many open files".
I quickly went through the sources and it seems that when LookupPath fails, and
cmd.Start is called, the open ends of the pipes associated to the command are not closed
at that time.
Initially I found it hard to reproduce the bug because when the GC gets time to run, it
will call the finalizers of the open files which end up closing the pipes. However, with
enough go routines running at the same time (which I had in my original program) the
problem can be reproduced quite easily.
I've attached a small pipebug.go file which demonstrates the problem.
by jessevdk:
Attachments:
The text was updated successfully, but these errors were encountered: