* [pve-devel] [PATCH storage] fix #3803: ZFSPoolPlugin: zfs_request: increase minimum timeout in worker
@ 2021-12-23 12:06 Dominik Csapak
2022-04-26 13:26 ` [pve-devel] applied: " Thomas Lamprecht
0 siblings, 1 reply; 2+ messages in thread
From: Dominik Csapak @ 2021-12-23 12:06 UTC (permalink / raw)
To: pve-devel
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 | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/PVE/Storage/ZFSPoolPlugin.pm b/PVE/Storage/ZFSPoolPlugin.pm
index 5f6befd..148e154 100644
--- a/PVE/Storage/ZFSPoolPlugin.pm
+++ b/PVE/Storage/ZFSPoolPlugin.pm
@@ -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);
--
2.30.2
^ permalink raw reply [flat|nested] 2+ messages in thread
* [pve-devel] applied: [PATCH storage] fix #3803: ZFSPoolPlugin: zfs_request: increase minimum timeout in worker
2021-12-23 12:06 [pve-devel] [PATCH storage] fix #3803: ZFSPoolPlugin: zfs_request: increase minimum timeout in worker Dominik Csapak
@ 2022-04-26 13:26 ` Thomas Lamprecht
0 siblings, 0 replies; 2+ messages in thread
From: Thomas Lamprecht @ 2022-04-26 13:26 UTC (permalink / raw)
To: Proxmox VE development discussion, Dominik Csapak
On 23.12.21 13:06, Dominik Csapak wrote:
> 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 | 7 ++++++-
> 1 file changed, 6 insertions(+), 1 deletion(-)
>
>
applied, thanks!
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2022-04-26 13:26 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-23 12:06 [pve-devel] [PATCH storage] fix #3803: ZFSPoolPlugin: zfs_request: increase minimum timeout in worker Dominik Csapak
2022-04-26 13:26 ` [pve-devel] applied: " Thomas Lamprecht
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox