networking.c/writeToClient: handle WSAEWOULDBLOCK

- fixed writeToClient() after failed tests
- adjusted tests to match antirez/redis@4.0.2
This commit is contained in:
Tomasz Poradowski
2018-08-02 00:31:59 +02:00
parent 155111f7e4
commit bdcf80ea4e
30 changed files with 770 additions and 131 deletions
+4 -2
View File
@@ -58,7 +58,8 @@ proc ::redis_cluster::__method__refresh_nodes_map {id} {
set idx 0; # Index of the node that will respond.
set errmsg {}
foreach start_node $::redis_cluster::startup_nodes($id) {
lassign [split $start_node :] start_host start_port
set ip_port [lindex [split $start_node @] 0]
lassign [split $ip_port :] start_host start_port
if {[catch {
set r {}
set r [redis $start_host $start_port]
@@ -68,7 +69,7 @@ proc ::redis_cluster::__method__refresh_nodes_map {id} {
if {$r ne {}} {catch {$r close}}
incr idx
if {[string length $errmsg] < 200} {
append errmsg " $start_node: $e"
append errmsg " $ip_port: $e"
}
continue ; # Try next.
} else {
@@ -98,6 +99,7 @@ proc ::redis_cluster::__method__refresh_nodes_map {id} {
set args [split $line " "]
lassign $args nodeid addr flags slaveof pingsent pongrecv configepoch linkstate
set slots [lrange $args 8 end]
set addr [lindex [split $addr @] 0]
if {$addr eq {:0}} {
set addr $start_host:$start_port
}
+1 -1
View File
@@ -334,7 +334,7 @@ proc start_server {options {code undefined}} {
while 1 {
# check that the server actually started and is ready for connections
if {[exec grep -i "ready to accept" | wc -l < $stdout] > 0} {
if {[exec grep -i "Ready to accept" | wc -l < $stdout] > 0} {
break
}
after 10