diff --git a/CHANGELOG.md b/CHANGELOG.md index 19449efddb..29da78e740 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ Changelog for FrostFS Node ### Changed ### Fixed - Copy number was not used for `PUT` requests (#284) +- Tree service panic in its internal client cache (#323) ### Removed ### Updated diff --git a/pkg/services/tree/cache.go b/pkg/services/tree/cache.go index ab9f509ac7..56b97e6878 100644 --- a/pkg/services/tree/cache.go +++ b/pkg/services/tree/cache.go @@ -36,7 +36,9 @@ var errRecentlyFailed = errors.New("client has recently failed") func (c *clientCache) init() { l, _ := simplelru.NewLRU[string, cacheItem](defaultClientCacheSize, func(_ string, value cacheItem) { - _ = value.cc.Close() + if conn := value.cc; conn != nil { + _ = conn.Close() + } }) c.LRU = *l }