Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Goroutine leak #9

Open
vboginskey opened this issue Aug 21, 2019 · 1 comment
Open

Goroutine leak #9

vboginskey opened this issue Aug 21, 2019 · 1 comment

Comments

@vboginskey
Copy link

The anonymous goroutine introduced in 4ca7e7b will never exit unless the command is aborted. This leaks a goroutine per successful invocation of ScanStream.

@Freeaqingme
Copy link
Contributor

Freeaqingme commented Aug 21, 2019

Good catch! I just looked at the code in which I used this library and I think I simply always called close on the abort channel.

Clearly this was way before context.Context became more commonly used, so my suggestion would be to rewrite it a little to use a context instead.

For what it's worth, I did use it in production extensively. So it is possible to use without goroutine leaks.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants