diff --git a/cmd/neofs-node/container.go b/cmd/neofs-node/container.go index 05ddc0b2..9ccb0c88 100644 --- a/cmd/neofs-node/container.go +++ b/cmd/neofs-node/container.go @@ -72,13 +72,15 @@ func initContainerService(c *cfg) { PlacementBuilder: loadPlacementBuilder, }) + clientCache := cache.NewSDKClientCache() // FIXME: use shared cache + loadRouter := loadroute.New( loadroute.Prm{ LocalServerInfo: c, RemoteWriterProvider: &remoteLoadAnnounceProvider{ key: c.key, loadAddrSrc: c, - clientCache: cache.NewSDKClientCache(), // FIXME: use shared cache + clientCache: clientCache, deadEndProvider: loadcontroller.SimpleWriterProvider(loadAccumulator), }, Builder: routeBuilder, @@ -86,6 +88,8 @@ func initContainerService(c *cfg) { loadroute.WithLogger(c.log), ) + c.onShutdown(clientCache.CloseAll) + ctrl := loadcontroller.New( loadcontroller.Prm{ LocalMetrics: loadcontroller.SimpleIteratorProvider(localMetrics), diff --git a/cmd/neofs-node/object.go b/cmd/neofs-node/object.go index 0ed2b339..825c0523 100644 --- a/cmd/neofs-node/object.go +++ b/cmd/neofs-node/object.go @@ -155,6 +155,8 @@ func initObjectService(c *cfg) { clientCache := cache.NewSDKClientCache( client.WithDialTimeout(c.viper.GetDuration(cfgAPIClientDialTimeout))) + c.onShutdown(clientCache.CloseAll) + clientConstructor := &reputationClientConstructor{ log: c.log, nmSrc: c.cfgObject.netMapStorage, diff --git a/cmd/neofs-node/reputation.go b/cmd/neofs-node/reputation.go index 0011ed92..6084383a 100644 --- a/cmd/neofs-node/reputation.go +++ b/cmd/neofs-node/reputation.go @@ -90,6 +90,8 @@ func initReputationService(c *cfg) { apiClientCache := cache.NewSDKClientCache() + c.onShutdown(apiClientCache.CloseAll) + remoteLocalTrustProvider := common.NewRemoteTrustProvider( common.RemoteProviderPrm{ LocalAddrSrc: c,