Skip to content

webrtcbin: Fix potential deadlock on bin elements cleanup

In MR !7675 (merged) I accidentally introduced a potential deadlock (blushing). When the conditions below happens at the same time it is possible to end up in a deadlock between the webrtc->priv->dc_lock, channel->src_bin pad mutex and association_mutex (from sctpassociation.c).

  • The remote peer requests to close a datachannel
  • The local peer is still pushing data to the same datachannel
  • The remote peer requests to open a new datachannel

The fix moves the teardown of the src & sink bins outside the region locking webrtc->priv->dc_lock.

Merge request reports

Loading