-
Notifications
You must be signed in to change notification settings - Fork 10
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
Deadlock when opening and closing connections concurrently #38
Comments
|
For |
I think we are fine? Because the channel is closed while holding the |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I ran into two different issues, one is a deadlock and the other is leaked goroutines. I'm not exactly sure if these goroutines will be cleaned at some point but I did see them in the debugger.
Deadlock
While trying to reproduce #36 with an automated test, I ran into a deadlock caused by a blocking channel write here that causes the goroutine to not release the
connectionsLock
.In the debugger I see a lot of goroutines blocked while trying to acquire that lock which is not possible because of that blocked channel write in the first goroutine.
I believe that this is because that channel is in fact
nil
due to this call toclose()
and writing to anil
channel blocks forever.Leaked goroutines
I also see several background goroutines blocked here and here.
This happens because neither channel is buffered so the write will only progress when a read happens but the
for
loop returns before reading from both when an error happens.Here is the test that I used to reproduce these issues:
The text was updated successfully, but these errors were encountered: