Skip to content
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

goroutine leak in Context.Run? #29

Open
ain-valtin opened this issue Jun 11, 2020 · 3 comments · May be fixed by #32
Open

goroutine leak in Context.Run? #29

ain-valtin opened this issue Jun 11, 2020 · 3 comments · May be fixed by #32

Comments

@ain-valtin
Copy link

It seems there is a goroutine leak in Context.Run: https://github.com/progrium/go-basher/blob/master/basher.go#L267 goroutine is launched which iterates over signals chan. But the chan is never closed, so the routine never exits... shouldn't there be something like

defer func() {
   signal.Stop(signals)
   close(signals)
}()

after signal.Notify(signals) call?

@josegonzalez
Copy link
Collaborator

Do you think #23 would resolve it?

@ain-valtin
Copy link
Author

No - the goroutine will still stay around until the signals chan is closed (which currently never happens).

@josegonzalez
Copy link
Collaborator

Hmmm I think that makes sense - @progrium thoughts? - and would take a PR :)

josegonzalez pushed a commit that referenced this issue Jan 10, 2021
@josegonzalez josegonzalez linked a pull request Jan 10, 2021 that will close this issue
josegonzalez pushed a commit that referenced this issue Mar 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants