From 72bdeea1bf02d2265909473d07863670fab8d491 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabian=20Gr=C3=BCnbichler?= Date: Fri, 25 Nov 2016 10:29:23 +0100 Subject: [PATCH] increase default timeout for zpool import as zpool import can easily take longer than 5 seconds on systems with lots of disks --- PVE/Storage/ZFSPoolPlugin.pm | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/PVE/Storage/ZFSPoolPlugin.pm b/PVE/Storage/ZFSPoolPlugin.pm index 10b10c4..227244d 100644 --- a/PVE/Storage/ZFSPoolPlugin.pm +++ b/PVE/Storage/ZFSPoolPlugin.pm @@ -165,8 +165,7 @@ sub path { sub zfs_request { my ($class, $scfg, $timeout, $method, @params) = @_; - $timeout = PVE::RPCEnvironment::is_worker() ? 60*60 : 5 - if !$timeout; + my $default_timeout = PVE::RPCEnvironment::is_worker() ? 60*60 : 5; my $cmd = []; @@ -174,6 +173,7 @@ sub zfs_request { push @$cmd, 'zpool', 'list'; } elsif ($method eq 'zpool_import') { push @$cmd, 'zpool', 'import'; + $default_timeout = 15 if $default_timeout < 15; } else { push @$cmd, 'zfs', $method; } @@ -187,6 +187,8 @@ sub zfs_request { $msg .= "$line\n"; }; + $timeout = $default_timeout if !$timeout; + run_command($cmd, errmsg => "zfs error", outfunc => $output, timeout => $timeout); return $msg;