From 9e0decd12dee7fbfbb717e35677fc0571dfee2aa Mon Sep 17 00:00:00 2001 From: Evgenii Stratonikov Date: Fri, 16 Dec 2022 09:54:00 +0300 Subject: [PATCH] [#2162] services/tree: Close connection after the syncronization There was a goroutine leak here. Signed-off-by: Evgenii Stratonikov --- CHANGELOG.md | 1 + pkg/services/tree/sync.go | 1 + 2 files changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4a8920f7d..053f914a9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -64,6 +64,7 @@ Changelog for NeoFS Node - Prioritize internal addresses for clients (#2156) - Force object removal via control service (#2145) - Synchronizing a tree now longer reports an error for a single-node container (#2154) +- Prevent leaking goroutines in the tree service (#2162) ### Removed - `-g` option from `neofs-cli control ...` and `neofs-cli container create` commands (#2089) diff --git a/pkg/services/tree/sync.go b/pkg/services/tree/sync.go index d14b4c540..7ea10d006 100644 --- a/pkg/services/tree/sync.go +++ b/pkg/services/tree/sync.go @@ -137,6 +137,7 @@ func (s *Service) synchronizeTree(ctx context.Context, d pilorama.CIDDescriptor, // Failed to connect, try the next address. return false } + defer cc.Close() treeClient := NewTreeServiceClient(cc) for {