[pve-devel] [PATCH storage 2/2] increase default timeout for zpool import

Fabian Grünbichler f.gruenbichler at proxmox.com
Fri Nov 25 10:29:23 CET 2016


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;
-- 
2.1.4





More information about the pve-devel mailing list