diff --git a/cmd/neofs-node/container.go b/cmd/neofs-node/container.go index 05ddc0b2ec..9ccb0c8841 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 0ed2b339c4..825c0523d0 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 0011ed9263..6084383a4e 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,