From 17177697b5f8d869a47687421712abbc48de1203 Mon Sep 17 00:00:00 2001 From: Alexander Chuprov Date: Wed, 5 Mar 2025 15:30:48 +0300 Subject: [PATCH] [#300] pool/cm: Remove unused mutex in 'statistics' Signed-off-by: Alexander Chuprov --- pool/connection_manager.go | 2 -- 1 file changed, 2 deletions(-) diff --git a/pool/connection_manager.go b/pool/connection_manager.go index 5b9a08de..b142529a 100644 --- a/pool/connection_manager.go +++ b/pool/connection_manager.go @@ -297,7 +297,6 @@ func (cm connectionManager) Statistic() Statistic { stat := Statistic{} for _, inner := range cm.innerPools { nodes := make([]string, 0, len(inner.clients)) - inner.lock.RLock() for _, cl := range inner.clients { if cl.isHealthy() { nodes = append(nodes, cl.address()) @@ -311,7 +310,6 @@ func (cm connectionManager) Statistic() Statistic { stat.nodes = append(stat.nodes, node) stat.overallErrors += node.overallErrors } - inner.lock.RUnlock() if len(stat.currentNodes) == 0 { stat.currentNodes = nodes }