Commit Graph

15 Commits

Author SHA1 Message Date
David Zhao
b5c8fe5294 Perform unsubscribe in parallel to avoid blocking (#1760)
* Perform unsubscribe in parallel to avoid blocking

When unsubscribing from tracks, we flush a blank frame in order to prepare
the transceivers for re-use. This process is blocking for ~200ms. If
the unsubscribes are performed serially, it would prevent other subscribe
operation from continuing.

This PR parallelizes that operation, and ensures subsequent subscribe
operations could reuse the existing transceivers.

* also perform in parallel when uptrack close

* fix a few log fields
2023-06-02 00:13:18 -07:00
cnderrauber
c1842cb54f Avoid reconnect loop for unsupported downtrack (#1754)
* Avoid reconnect loop for unsupported downtrack

If the client subscribes to a track which codec is unsupported by the
client, sfu will trigger negotiation failed and issue a full reconnect
after received client answer. If the client try to subscribe that track
then it will got full reconnect again. That will cause a infinite
reconnect loop until the client don't subscribe that track. This PR
will unsubscribe the error track for the client and send a
SubscriptionResponse that contain the reason to indicates the track's
codec is not supported to avoid the reconnect loop.
2023-05-31 11:41:22 +08:00
Raja Subramanian
1148d38978 hopefully more stable tests (#1665)
* hopefully more stable tests

* do eventual checks as some callbacks happen in go routines.

Needs a bit more work to ensure that some conditions do not happen.
But, with goroutines, the amount of wait is always tricky.``
2023-04-28 17:02:31 +05:30
Raja Subramanian
c1c4e8aea0 Include packetsMissing field in string representation (#1659)
* Include packetsMissing field in string representation

* do not set stub directly
2023-04-27 14:39:05 +05:30
cnderrauber
09af509edb Add subscription limits (#1629)
* Add subscription limits

* Add limit to ParticipantParams

* Don't change desired of subscription when reaching limits

* Add subscription limits config

* Revert comment

* solve comments
2023-04-20 14:15:30 +08:00
cnderrauber
d9cd07c4b1 Return chosen codec for simulcast codecs (#1624)
* Return chosen codec for simulcast codecs

* Increase timeout for subscription test
2023-04-17 15:31:28 +08:00
David Zhao
40ceddd18b Integrate QueuedNotifier, fixes out-of-order delivery (#1615) 2023-04-15 01:20:23 -07:00
David Zhao
f8a94c2125 Fixed timing-related failures with tests (#1608) 2023-04-12 21:01:57 -07:00
David Zhao
82fd3e865e Fix deadlock caused by subscription manager test (#1563)
We held the lock if subscription length check fails
2023-03-30 17:10:32 -07:00
imcdd
1f4fd6aafe 1. Fix wrong atomic pkg from go1.19 std sync/atomic to go.uber.org/atomic (#1479)
2. Fix CI buildtest config '>=1.18' to '1.18',ensure compatibility with go1.18
2023-03-07 23:27:26 -08:00
David Zhao
ade26f7c9e Keep track of pending reconciles to avoid duplicate queueReconcile (#1474) 2023-02-26 23:45:32 -08:00
David Zhao
2851a8ac98 Improved robustness of subscription stack (#1382)
UpdateSubscription had a shortcoming where when it couldn't find the
participant, it ignored the request.

This PR further removes the reliance of current publisher state from
subscribers.
- SubscribeToTrack only takes in a trackID
- Introduced RoomTrackManager to maintain all published tracks to a room
- Added TrackUnpublished event to clearly indicate when a track has been removed
- SubscribeRequested event no longer include information about the publisher
2023-02-06 18:08:26 -08:00
David Zhao
8c513a1fc5 Improve SubscriptionManagerTest resilience (#1370)
This check fails on GH Actions occasionally due to timing differences.
2023-02-01 22:55:57 -08:00
David Zhao
c146398f32 Improved subscription manager logging to help with debugging (#1337) 2023-01-26 23:31:03 -08:00
David Zhao
cd6b8b80b9 feat: SubscriptionManager to consolidate subscription handling (#1317)
Added a new manager to handle all subscription needs. Implemented using reconciler pattern. The goals are:

improve subscription resilience by separating desired state and current state
reduce complexity of synchronous processing
better detect failures with the ability to trigger full reconnect
2023-01-24 23:06:16 -08:00