]> git.saurik.com Git - redis.git/commitdiff
in kill_server send the signal once, then wait for up to 5sec before sending lethal...
authorPremysl Hruby <dfenze@gmail.com>
Tue, 3 Apr 2012 12:18:35 +0000 (14:18 +0200)
committerantirez <antirez@gmail.com>
Thu, 5 Apr 2012 09:04:14 +0000 (11:04 +0200)
tests/support/server.tcl

index 984270adb1b47e803d4e44825b3114df08423792..b1ab38fc1089afcfae386c14d16f5ff041fecc3f 100644 (file)
@@ -46,11 +46,16 @@ proc kill_server config {
     }
 
     # kill server and wait for the process to be totally exited
+    catch {exec kill $pid}
     while {[is_alive $config]} {
-        if {[incr wait 10] % 1000 == 0} {
+        incr wait 10
+
+        if {$wait >= 5000} {
+            puts "Forcing process $pid to exit..."
+            catch {exec kill -KILL $pid}
+        } elseif {$wait % 1000 == 0} {
             puts "Waiting for process $pid to exit..."
         }
-        catch {exec kill $pid}
         after 10
     }