Fix missing participant updates race (#163)

* Fix faulty participant update buffering.

* Fix bug with broadcasting out of order

* dedicated participant update worker, without locks

* use tracker to drop duplicate/out of date messages

* additional lock around filter logic
This commit is contained in:
David Zhao
2021-10-31 15:20:46 -07:00
committed by GitHub
parent f3e916e2fe
commit 7442551ae5
12 changed files with 134 additions and 148 deletions
+2 -14
View File
@@ -186,20 +186,8 @@ func (r *LocalRoomManager) StartSession(ctx context.Context, roomName string, pi
"nodeID", r.currentNode.Id,
"participant", pi.Identity,
)
// close previous sink, and link to new one
prevSink := participant.GetResponseSink()
if prevSink != nil {
prevSink.Close()
}
participant.SetResponseSink(responseSink)
if err := participant.SendParticipantUpdate(rtc.ToProtoParticipants(room.GetParticipants())); err != nil {
logger.Warnw("failed to send participant update", err,
"participant", pi.Identity)
}
if err := participant.ICERestart(); err != nil {
logger.Warnw("could not restart ICE", err,
if err = room.ResumeParticipant(participant, responseSink); err != nil {
logger.Warnw("could not resume participant", err,
"participant", pi.Identity)
}
return