You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello everyone, this is my first GitHub issue, so please guide me if I am doing something wrong. I am trying to create a simple server which will accept requests from a browser and create a WebRTC connection with audio track. I noticed that if I reload the page shortly after connection is established, goroutine leak will be created.
Here are results from profiler:
Important: I can reproduce this issue only when the server is located on a remote host. I cannot reproduce it on the local server.
What did you expect?
WebRTC connection to close properly.
What happened?
PeerConnection is closing partially, and the interceptor goroutines are never closing.
Seams like PeerConnection.close() stuck during execution. To be more specific it stuck at iceTransport.GracefulStop():
repository - webrtc, file - peerconnection.go: 2443 if pc.iceTransport != nil { 2444 here --> gracefulCloseErrors = append(gracefulCloseErrors, pc.iceTransport.GracefulStop()) 2445 }
I investigated it a little bit, and i think problem is in handlerNotifier.Close() function. If Close() is graceful we will need to wait for WaitGroup to unblock the execution:
repository - ice, file - agent_handlers.go: 68 if graceful { 69 // if we were closed ungracefully before, we now 70 // want ot wait. 71 here --> defer h.notifiers.Wait() 72 }
I assume that handlerNotifier.EnqueueConnectionState() function never gets to "WaitGroup.done()" for some reason.
Activity
charlieblevins commentedon Nov 25, 2025
@denis1kor could you please re-post the profiler image? I'm seeing a broken image link (see below).
can you supply a small program that reproduces the issue?
JoTurk commentedon Nov 26, 2025
@denis1kor @charlieblevins can you please check if this pion/ice#840 fixes this issue?
JoTurk commentedon Nov 26, 2025
I'll reopen this until the fix is confirmed
denis1kor commentedon Nov 27, 2025
@charlieblevins i re-posted the image. I will create the program that reproduces the issue and attach it to the report in few days
denis1kor commentedon Nov 27, 2025
@joeturki Unfortunately, i still can reproduce this issue
JoTurk commentedon Nov 27, 2025
@denis1kor we're currently trying this fix for another issue (maybe it's related) pion/sctp@0c627f6
Do you know if it happens only for ICE-TCP? Is there a way for me to debug this issue and how to reproduce it?
Edit: if you're using TCP and datachannels this probably fixes this issue : pion/sctp#441