marsadm: convert wait_cluster to new timeout method

This commit is contained in:
Thomas Schoebel-Theuer 2019-11-20 08:08:11 +01:00
parent f0fc9ea985
commit 86a06005c6
1 changed files with 2 additions and 3 deletions

View File

@ -1086,13 +1086,13 @@ sub wait_cluster {
my $hosts = shift || "*"; my $hosts = shift || "*";
my $abort = shift; my $abort = shift;
$abort = $force unless defined($abort); $abort = $force unless defined($abort);
my $old_timeout = $timeout; $timeout_val = undef;
finish_links(); finish_links();
my $start_time = mars_time(); my $start_time = mars_time();
my %old_status = get_alive_links($res, "time", $hosts); my %old_status = get_alive_links($res, "time", $hosts);
_trigger($hosts =~ m/\*/ ? 3 : 2); _trigger($hosts =~ m/\*/ ? 3 : 2);
lprint "Ping and wait for answers from " . join(",", sort(keys(%old_status))) . "\n" if %old_status; lprint "Ping and wait for answers from " . join(",", sort(keys(%old_status))) . "\n" if %old_status;
my $delta = $timeout > 0 ? $timeout : 30; my $delta = $window > 0 ? $window / 2 : 30;
while (1) { while (1) {
my $dead_count = 0; my $dead_count = 0;
my $alive_count = 0; my $alive_count = 0;
@ -1121,7 +1121,6 @@ sub wait_cluster {
sleep_timeout(); sleep_timeout();
last if $timeout_val <= 0 && !$unknown_count; last if $timeout_val <= 0 && !$unknown_count;
} }
$timeout = $old_timeout;
} }
sub wait_cluster_noforce { sub wait_cluster_noforce {