Do not hold lock while invoking resolver. (#816)

* Do not hold lock while invoking resolver.

Resolver is in room and it will grab its lock.
It is called from partcipant when checking permissions.
Permissions processing uses the participant lock.
So, not a good idea to call a room function with
participant lock held. Avoid that.

Also, use a full lock in the add/remove subscription
path. This is to ensure that permissions path and
subscription path (like subscribing to new participant's
tracks) do not race. As subscriptions are queued now
on the subscriber side, this should be fine.

* Revoke path resolution in ops queue goroutine

* fix test
This commit is contained in:
Raja Subramanian
2022-07-07 13:24:26 +05:30
committed by GitHub
parent 52aed86080
commit 177061712c
3 changed files with 128 additions and 84 deletions
+1 -1
View File
@@ -1558,7 +1558,7 @@ func (p *ParticipantImpl) addPendingTrackLocked(req *livekit.AddTrackRequest) *l
}
if req.Sid != "" {
track := p.getPublishedTrack(livekit.TrackID(req.Sid))
track := p.GetPublishedTrack(livekit.TrackID(req.Sid))
if track == nil {
p.params.Logger.Infow("track not found for new codec publish", "trackID", req.Sid)
return nil