Add option to issue full reconnect on data channel error. (#2026)

* Add option to issue full reconnect on data channel error.

There are situations where send data packet fails because of "stream
closed". It is unclear when that happens. Seems to be after an
ICERestart after ICE failed and connection type switching to TURN
from ICE.

Once the failure happens, it is not recoverable. Potentially, it is
recoverable, but unclear where the problem lies. Attempts to reproduce
looking at the pattern of failures has been unsuccesful.

In the mean time, adding an option to issue full reconnect
when send data packet fails.

* typo
This commit is contained in:
Raja Subramanian
2023-09-01 17:59:25 +05:30
committed by GitHub
parent b4efbe21a1
commit 6509bb0325
6 changed files with 34 additions and 6 deletions
+6
View File
@@ -355,6 +355,11 @@ func (r *RoomManager) StartSession(
if r.config.RTC.ReconnectOnSubscriptionError != nil {
reconnectOnSubscriptionError = *r.config.RTC.ReconnectOnSubscriptionError
}
// default do not force full reconnect on a data channel error
reconnectOnDataChannelError := false
if r.config.RTC.ReconnectOnDataChannelError != nil {
reconnectOnDataChannelError = *r.config.RTC.ReconnectOnDataChannelError
}
subscriberAllowPause := r.config.RTC.CongestionControl.AllowPause
if pi.SubscriberAllowPause != nil {
subscriberAllowPause = *pi.SubscriberAllowPause
@@ -389,6 +394,7 @@ func (r *RoomManager) StartSession(
},
ReconnectOnPublicationError: reconnectOnPublicationError,
ReconnectOnSubscriptionError: reconnectOnSubscriptionError,
ReconnectOnDataChannelError: reconnectOnDataChannelError,
VersionGenerator: r.versionGenerator,
TrackResolver: room.ResolveMediaTrackForSubscriber,
SubscriberAllowPause: subscriberAllowPause,