summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorantirez <antirez@gmail.com>2014-05-14 09:10:03 +0200
committerantirez <antirez@gmail.com>2014-05-14 09:10:03 +0200
commit27ca133d35323346714c0af5a650d3a8c0238099 (patch)
tree77b6ffe517638dc8279610214a09b6528fe0fcc6
parentcdf2271c5b8c8574f8441cd1214ed28d9cb583db (diff)
downloadredis-27ca133d35323346714c0af5a650d3a8c0238099.tar.gz
cluster.tcl: fix redis links leak in refresh_nodes_map.
-rw-r--r--tests/support/cluster.tcl8
1 files changed, 7 insertions, 1 deletions
diff --git a/tests/support/cluster.tcl b/tests/support/cluster.tcl
index 79d9244d0..b007e3b05 100644
--- a/tests/support/cluster.tcl
+++ b/tests/support/cluster.tcl
@@ -64,7 +64,6 @@ proc ::redis_cluster::__method__refresh_nodes_map {id} {
set r [redis $start_host $start_port]
set nodes_descr [$r cluster nodes]
$r close
- puts $e
} e]} {
if {$r ne {}} {catch {$r close}}
incr idx
@@ -123,6 +122,13 @@ proc ::redis_cluster::__method__refresh_nodes_map {id} {
lappend ::redis_cluster::startup_nodes($id) $addr
}
+ # Close all the existing links in the old nodes map, and set the new
+ # map as current.
+ foreach n $::redis_cluster::nodes($id) {
+ catch {
+ [dict get $n link] close
+ }
+ }
set ::redis_cluster::nodes($id) $nodes
# Populates the slots -> nodes map.