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:
Thomas Lamprecht
2020-10-27 07:03:17 +01:00
parent a9078a7922
commit 70232472bc
2 changed files with 4 additions and 8 deletions

View File

@ -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) &&

View File

@ -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;
}