mirror of
https://github.com/livekit/livekit.git
synced 2026-03-30 15:35:41 +00:00
Fix SIP client timeout. (#4345)
This commit is contained in:
@@ -72,7 +72,7 @@ func InitializeServer(conf *config.Config, currentNode routing.LocalNode) (*Live
|
||||
getIngressStore,
|
||||
getIngressConfig,
|
||||
NewIngressService,
|
||||
rpc.NewSIPClientWithParams,
|
||||
newSIPClient,
|
||||
getSIPStore,
|
||||
getSIPConfig,
|
||||
NewSIPService,
|
||||
@@ -225,6 +225,19 @@ func getIngressConfig(conf *config.Config) *config.IngressConfig {
|
||||
return &conf.Ingress
|
||||
}
|
||||
|
||||
func newSIPClient(p rpc.ClientParams) (rpc.SIPClient, error) {
|
||||
// Do not pass parameters directly, as they set timeout that is too short,
|
||||
// and might set retry policy that is not acceptable for SIP methods.
|
||||
// Instead, set relevant parameters manually.
|
||||
return rpc.NewSIPClientWithParams(rpc.ClientParams{
|
||||
Bus: p.Bus,
|
||||
ClientOptions: []psrpc.ClientOption{
|
||||
rpc.WithClientLogger(p.Logger),
|
||||
otelpsrpc.ClientOptions(otelpsrpc.Config{}),
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
func getSIPStore(s ObjectStore) SIPStore {
|
||||
switch store := s.(type) {
|
||||
case *RedisStore:
|
||||
|
||||
@@ -115,7 +115,7 @@ func InitializeServer(conf *config.Config, currentNode routing.LocalNode) (*Live
|
||||
}
|
||||
ingressService := NewIngressService(ingressConfig, nodeID, messageBus, ingressClient, ingressStore, ioInfoService, telemetryService)
|
||||
sipConfig := getSIPConfig(conf)
|
||||
sipClient, err := rpc.NewSIPClientWithParams(clientParams)
|
||||
sipClient, err := newSIPClient(clientParams)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -290,6 +290,14 @@ func getIngressConfig(conf *config.Config) *config.IngressConfig {
|
||||
return &conf.Ingress
|
||||
}
|
||||
|
||||
func newSIPClient(p rpc.ClientParams) (rpc.SIPClient, error) {
|
||||
|
||||
return rpc.NewSIPClientWithParams(rpc.ClientParams{
|
||||
Bus: p.Bus,
|
||||
ClientOptions: []psrpc.ClientOption{rpc.WithClientLogger(p.Logger), otelpsrpc.ClientOptions(otelpsrpc.Config{})},
|
||||
})
|
||||
}
|
||||
|
||||
func getSIPStore(s ObjectStore) SIPStore {
|
||||
switch store := s.(type) {
|
||||
case *RedisStore:
|
||||
|
||||
Reference in New Issue
Block a user