fix #3097: cifs, nfs: increase connection check timeout to 10s
we already have the ZFS pool plugin as precedent to use 10s, at for network with remote off-site storage one can get to 200 - 300ms RTT latency, which means that for a protocol needing multiple rounds of communication, one can easily get over 2s while not being in a broken network. Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
@ -262,14 +262,12 @@ sub check_connection {
|
||||
} else {
|
||||
push @$cmd, '-U', 'Guest','-N';
|
||||
}
|
||||
|
||||
push @$cmd, '-c', 'echo 1 0';
|
||||
|
||||
my $out_str;
|
||||
eval {
|
||||
run_command($cmd, timeout => 2, outfunc => sub {$out_str .= shift;},
|
||||
errfunc => sub {});
|
||||
};
|
||||
my $out = sub { $out_str .= shift };
|
||||
|
||||
eval { run_command($cmd, timeout => 10, outfunc => $out, errfunc => sub {}) };
|
||||
|
||||
if (my $err = $@) {
|
||||
die "$out_str\n" if defined($out_str) &&
|
||||
|
||||
@ -166,9 +166,7 @@ sub check_connection {
|
||||
|
||||
my $cmd = ['/sbin/showmount', '--no-headers', '--exports', $server];
|
||||
|
||||
eval {
|
||||
run_command($cmd, timeout => 2, outfunc => sub {}, errfunc => sub {});
|
||||
};
|
||||
eval { run_command($cmd, timeout => 10, outfunc => sub {}, errfunc => sub {}) };
|
||||
if (my $err = $@) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user