marsadm: report errors during wait for primary

This commit is contained in:
Thomas Schoebel-Theuer 2013-05-14 09:59:00 +02:00
parent 6c3d225f1d
commit 3f6d1d8858
1 changed files with 10 additions and 1 deletions

View File

@ -1241,9 +1241,18 @@ sub primary_phase4 {
return if $force;
my $name = get_link("$mars/resource-$res/device-$host");
my $dev = "/dev/mars/$name";
my $backoff = 1;
my $round = 0;
while (! -e $dev) {
my $text = get_error_text($cmd, $res);
lprint $text if $text;
lprint "device '$dev' not yet present\n";
sleep_timeout(1);
sleep_timeout($backoff);
# very slowly increasing backoff
if ($backoff < 10 && $round++ > 5) {
$round = 0;
$backoff++;
}
}
lprint "device '$dev' is present\n" if -b $dev;
}