Add option to issue full reconnect on a publication error. (#1214)

* Add option to issue full reconnect on a publication error.

Leaving the publication error timeout at 30 seconds as there
are some publications taking long. Also, there are cases
where the peer connection fails after 30 seconds. The peer
connection failure happens after publication error is detected.
But, 30 seconds is a good amount of time for publication to establish.

* prevent recursive lock
This commit is contained in:
Raja Subramanian
2022-12-06 14:46:59 +05:30
committed by GitHub
parent 6f27d683a9
commit 6bd5504bff
6 changed files with 90 additions and 36 deletions
+3
View File
@@ -85,6 +85,9 @@ type RTCConfig struct {
// for testing, disable UDP
ForceTCP bool `yaml:"force_tcp,omitempty"`
// force a reconnect on a publication error
ReconnectOnPublicationError *bool `yaml:"reconnect_on_publication_error,omitempty"`
}
type TURNServer struct {
+7 -4
View File
@@ -42,10 +42,11 @@ func TestGeneratedFlags(t *testing.T) {
app.Flags = append(app.Flags, generatedFlags...)
set := flag.NewFlagSet("test", 0)
set.Bool("rtc.use_ice_lite", true, "") // bool
set.String("redis.address", "localhost:6379", "") // string
set.Uint("prometheus_port", 9999, "") // uint32
set.Bool("rtc.allow_tcp_fallback", true, "") // pointer
set.Bool("rtc.use_ice_lite", true, "") // bool
set.String("redis.address", "localhost:6379", "") // string
set.Uint("prometheus_port", 9999, "") // uint32
set.Bool("rtc.allow_tcp_fallback", true, "") // pointer
set.Bool("rtc.reconnect_on_publication_error", true, "") // pointer
c := cli.NewContext(app, set, nil)
conf, err := NewConfig("", true, c, nil)
@@ -56,4 +57,6 @@ func TestGeneratedFlags(t *testing.T) {
require.Equal(t, uint32(9999), conf.PrometheusPort)
require.NotNil(t, conf.RTC.AllowTCPFallback)
require.True(t, *conf.RTC.AllowTCPFallback)
require.NotNil(t, conf.RTC.ReconnectOnPublicationError)
require.True(t, *conf.RTC.ReconnectOnPublicationError)
}