Fix SIP client timeout. (#4345)

This commit is contained in:
Denys Smirnov
2026-03-05 19:09:17 +02:00
committed by GitHub
parent 52c28a938d
commit 493e87dfd4
2 changed files with 23 additions and 2 deletions

View File

@@ -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:

View File

@@ -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: