lynckia/licode

PeerConnection is not removed after unpublish

vpoddubchak opened this issue · 4 comments

Description

PeerConnection remains active after Unpublish of media in BasicExample.

Steps to reproduce the issue:

  1. Deploy the latest licode in docker by this command: MIN_PORT=30000; MAX_PORT=30150; sudo docker run --name licode -p 3000:3000 -p $MIN_PORT-$MAX_PORT:$MIN_PORT-$MAX_PORT/udp -p 3001:3001 -p 3004:3004 -p 8080:8080 -e "MIN_PORT=$MIN_PORT" -e "MAX_PORT=$MAX_PORT" -e "PUBLIC_IP=<your_domain>" lynckia/licode:develop
  2. Configure nginx and licode to use ssl based on this instruction: http://lynckia.com/licode/nginx-dep.html
  3. Open page <your_domain> and see your local preview on BasicExample page (and no errors in console)
  4. Open chrome://webrtc-internals page to check that PeerConection object is active
  5. Press Unpublish btn on BasicExample page
  6. Check webrtc-internals page: PeerConnection is still active. It will disapper only when tab with BasicExample will be closed.

Note:

  • The same happens when you unsubscribe to a participant.
  • This is something new: we did not see such issue before.

Our tests shows that it start to happen after this commit:
da4c767

I did mistake. Commit which caused this bug is: 279d4d8

Hello, we have reproduced this issue and it is a blocker issue for our use case (lots of subscriptions).

This problem can cause this error : "Failed to construct 'RTCPeerConnection': Cannot create so many PeerConnections"

while handling lots of subscriptions or stream recoveries.

Since the connections are being piled up just by starting/ending the subscriptions, it could be easy to reproduce in certain use cases.

This is a byproduct of how we handle unified plan. I would suggest enabling single PeerConnection (singlePC) if you are going to have many subscriptions in a session.