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

panic on graceful shutdown #24

Open
tc-hib opened this issue Dec 4, 2020 · 4 comments
Open

panic on graceful shutdown #24

tc-hib opened this issue Dec 4, 2020 · 4 comments
Milestone

Comments

@tc-hib
Copy link

tc-hib commented Dec 4, 2020

Hello, when using the Shutdown method, I get a panic:

panic: send on closed channel

This is because the removeClient channel is closed before all HTTP handlers got closed.

I am a beginner, but to me it looks like we should never close removeClient.
But it will allow a goroutine leak, since goroutines trying to send on this channel will remain blocked.

I'll try to post a PR.

@tc-hib tc-hib mentioned this issue Dec 4, 2020
@alexandrevicenzi
Copy link
Owner

Share the code that you have, there are tests covering this area, it should work.

@tc-hib
Copy link
Author

tc-hib commented Dec 5, 2020

Hello, thanks for answering so quickly. In my PR the test reproduces the panic. I'm new to all this git stuff, sorry, I should have committed the test separately from the fix.

@alexandrevicenzi alexandrevicenzi added this to the dev milestone Dec 8, 2020
@Jbaukens
Copy link

Hello, hope u are doing well

Is there eventually any update about this ? I am getting each time i do a ctrl+c a panic when calling shutdown like above stated

Regards

@alexandrevicenzi
Copy link
Owner

Yes, there's going to be a fix, I was working on it, but right now I don't have time to continue it.

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.

3 participants