-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
DataChannel.readLoop goroutine leak #2098
Comments
This was referenced Mar 31, 2022
mafredri
added a commit
to mafredri/sctp
that referenced
this issue
Aug 2, 2022
It was possible for new `Stream`s to be created after readLoop has exited and called `unregisterStream` on the existing ones. The new `Stream`s would never close. This may fix pion/webrtc#2098.
@lenaky Does pion/sctp#236 solve your issue? |
mafredri
added a commit
to mafredri/sctp
that referenced
this issue
Aug 2, 2022
* Always close `Association` on `writeLoop` exit The connection will now always be closed on `writeLoop` exit because it will ensure that `readLoop` exits, which is needed to propagate the closing of `Stream`s. * Guard against creating `Stream`s after `Association` close It was possible for new `Stream`s to be created after `readLoop` has exited and called `unregisterStream` on the existing ones. The new `Stream`s would never close. This also guards against a potential panic due to send on nil channel (`acceptCh`). This may fix pion/webrtc#2098.
@mafredri sorry for late. I didn't fix this issue and I'll check and let u know ur PR work for me. thanks! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Your environment.
What did you do?
I got goroutine leak from our system which is based on ion-sfu.
As you can see,
Stream.ReadSCTP
hangs while waiting for signal atStream.readNotifier
.at that moment association and dataChannel have been already closed.
I presume while
SCTPTransport.Start
is in progress,Association.readLoop
is closed andAssociation.unregisterStream
which is defer action does not affect ifAssociation.OpenStream
not called yet.I don't know exactly what causes this. I think may be It happens when peerConnection closed while data channel connection is being established.
What did you expect?
What happened?
The text was updated successfully, but these errors were encountered: