]> git.proxmox.com Git - pve-storage.git/commitdiff
fix #3803: ZFSPoolPlugin: zfs_request: increase minimum timeout in worker
authorDominik Csapak <d.csapak@proxmox.com>
Thu, 23 Dec 2021 12:06:22 +0000 (13:06 +0100)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Tue, 26 Apr 2022 13:19:50 +0000 (15:19 +0200)
Since most zfs operations can take a while (under certain conditions),
increase the minimum timeout for zfs_request in workers to 5 minutes.

We cannot increase the timeouts in synchronous api calls, since they are
hard limited to 30 seconds, but in worker we do not have such limits.

The existing default timeout does not change (60minutes in worker,
5seconds otherwise), but all zfs_requests with a set timeout (<5minutes)
will use the increased 5 minutes in a worker.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
PVE/Storage/ZFSPoolPlugin.pm

index 343f833361b95469e32cd21d808b0f4cea579bc2..b1ee420e87139d9e21380bc23697730b7ac692c7 100644 (file)
@@ -178,7 +178,12 @@ sub zfs_request {
     my $msg = '';
     my $output = sub { $msg .= "$_[0]\n" };
 
-    $timeout = PVE::RPCEnvironment->is_worker() ? 60*60 : 5 if !$timeout;
+    if (PVE::RPCEnvironment->is_worker()) {
+       $timeout = 60*60 if !$timeout;
+       $timeout = 60*5 if $timeout < 60*5;
+    } else {
+       $timeout = 5 if !$timeout;
+    }
 
     run_command($cmd, errmsg => "zfs error", outfunc => $output, timeout => $timeout);