public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Jakob Klocker <j.klocker@proxmox.com>
To: pve-devel@lists.proxmox.com
Cc: Jakob Klocker <j.klocker@proxmox.com>
Subject: [PATCH pve-storage v2 2/2] fix #7598: qemu-img: increase timeout for image resizing in worker context
Date: Tue,  4 Aug 2026 11:04:38 +0200	[thread overview]
Message-ID: <20260804090438.58491-3-j.klocker@proxmox.com> (raw)
In-Reply-To: <20260804090438.58491-1-j.klocker@proxmox.com>

Mirror ZFS behaviour and increase timeout to an hour when in a worker
context. This fixes issues some users [0] have with slow disks where a
resize would fail.

[0] https://bugzilla.proxmox.com/show_bug.cgi?id=7598

Signed-off-by: Jakob Klocker <j.klocker@proxmox.com>
---
 src/PVE/Storage/Common.pm | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/PVE/Storage/Common.pm b/src/PVE/Storage/Common.pm
index 725f623..ee95653 100644
--- a/src/PVE/Storage/Common.pm
+++ b/src/PVE/Storage/Common.pm
@@ -3,6 +3,7 @@ package PVE::Storage::Common;
 use v5.36;
 
 use PVE::JSONSchema;
+use PVE::RPCEnvironment;
 use PVE::Syscall;
 use PVE::Tools qw(run_command);
 
@@ -263,7 +264,7 @@ sub qemu_img_measure {
 
 Resize a qemu image C<$path> with format C<$format> to a target Kb size C<$size>.
 C<$preallocation> allows to specify the preallocation option for the resize operation.
-The operation uses a default timeout of 10s.
+The operation uses a default timeout of 10s, or 1 hour when running in a worker context.
 
 =cut
 
@@ -276,7 +277,7 @@ sub qemu_img_resize {
     push $cmd->@*, "--preallocation=$preallocation" if $preallocation;
     push $cmd->@*, '-f', $format, $path, $size;
 
-    my $timeout = 10;
+    my $timeout = PVE::RPCEnvironment->is_worker() ? 60 * 60 : 10;
     run_command($cmd, timeout => $timeout);
 }
 
-- 
2.47.3




  parent reply	other threads:[~2026-08-04  9:04 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-04  9:04 [PATCH storage v2 0/2] fix #7598: qemu-img: increase timeout for image resize Jakob Klocker
2026-08-04  9:04 ` [PATCH pve-storage v2 1/2] qemu-img: drop unused image resize timeout parameter Jakob Klocker
2026-08-05 15:20   ` Elias Huhsovitz
2026-08-04  9:04 ` Jakob Klocker [this message]
2026-08-05 15:30   ` [PATCH pve-storage v2 2/2] fix #7598: qemu-img: increase timeout for image resizing in worker context Elias Huhsovitz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260804090438.58491-3-j.klocker@proxmox.com \
    --to=j.klocker@proxmox.com \
    --cc=pve-devel@lists.proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal