提交 f727000f 编写于 作者: A antirez

cluster.tcl: fix redis links leak in refresh_nodes_map.

上级 4db4a5d5
......@@ -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.
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册