Keep subscription synchronous when publisher is expected to resume. (#4424)
Subscription can switch between remote track and local track or vice-versa. When that happens, closing the subscribed track of one or the other asynchronously means the re-subscribe could race with subscribed track closing. Keeping the case of `isExpectedToResume` sync to prevent the race. Would be good to support multiple subscribed tracks per subscription. So, when subscribed track closes, subscription manager can check and close the correct subscribed track. But, it gets complex to clearly determine if a subccription is pending or not and other events. So, keeping it sync.
This commit is contained in:
@@ -1620,7 +1620,7 @@ func (p *ParticipantImpl) SetMigrateState(s types.MigrateState) {
|
||||
// callback could close the remote participant/tracks before the local track
|
||||
// is fully active.
|
||||
//
|
||||
// that could lead subscribers to unsubscribe due to source
|
||||
// that could lead to subscribers unsubscribing due to source
|
||||
// track going away, i. e. in this case, the remote track close would have
|
||||
// notified the subscription manager, the subscription manager would
|
||||
// re-resolve to check if the track is still active and unsubscribe if none
|
||||
|
||||
Reference in New Issue
Block a user