-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
goroutines leakage in runDialStdio #1736
Comments
ping @ijc @AkihiroSuda ptal |
Thanks for reporting this issue
I clicked "Run" button, but it only shows |
did you wait till it ends? it calls runDialStdio 300 times with 100ms delay, and displays profile info every 100, starting with 1, so basically output looks like:
|
Fix docker#1736 Signed-off-by: Akihiro Suda <suda.akihiro@lab.ntt.co.jp>
PR: #1772 |
Fix docker#1736 Signed-off-by: Akihiro Suda <suda.akihiro@lab.ntt.co.jp> (cherry picked from commit f8d4c44) Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
It looks like function runDialStdio
cli/cli/command/system/dial_stdio.go
Line 29 in c3fc547
copier(connHalfCloser, &halfReadCloserWrapper{os.Stdin}, "stdin to stream")
completes successfully before another goroutine.The problem is that in all other 'bad' paths we exit function without listening another channel, in that case writing to the channel will block goroutine forever.
Here the snippet to demonstrate this problem:
https://play.golang.org/p/lVr92dAgPbh
If we run this code, in the end of output we can see:
meaning that there are 301 goroutines blocked at main.go:33
Probably the easiest way to fix it is to create 'buffered' channels:
not sure if it is the best solution though, so creating this issue for now.
Also it doesn't really very serious issue in our case, as we exit process right after we exit runDialStdio, but it feels wrong to keep code with such problems.
The text was updated successfully, but these errors were encountered: