]> git.proxmox.com Git - pve-storage.git/commitdiff
increase default timeout for zpool import
authorFabian Grünbichler <f.gruenbichler@proxmox.com>
Fri, 25 Nov 2016 09:29:23 +0000 (10:29 +0100)
committerDietmar Maurer <dietmar@proxmox.com>
Tue, 29 Nov 2016 08:30:26 +0000 (09:30 +0100)
as zpool import can easily take longer than 5 seconds on
systems with lots of disks

PVE/Storage/ZFSPoolPlugin.pm

index 10b10c4f0154137de1ea05a3fbff7011e960a361..227244dfbe3e90b873611d93bbdf9b2f0a589aec 100644 (file)
@@ -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;