all lists on 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 v3 2/2] fix #7598: qemu-img: increase timeout for image resizing in worker context
Date: Tue, 11 Aug 2026 09:37:40 +0200	[thread overview]
Message-ID: <20260811073740.100398-3-j.klocker@proxmox.com> (raw)
In-Reply-To: <20260811073740.100398-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 | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/PVE/Storage/Common.pm b/src/PVE/Storage/Common.pm
index 3932aee..1c3fdad 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);
 
@@ -262,8 +263,8 @@ sub qemu_img_measure {
     qemu_img_resize($path, $format, $size, $preallocation, $timeout)
 
 Resize a qemu image C<$path> with format C<$format> to a target Kb size C<$size>.
-Default timeout C<$timeout> is 10s if not specified.
 C<$preallocation> allows to specify the preallocation option for the resize operation.
+If no C<$timeout> is provided, it defaults to 10 seconds, or 1 hour when running in a worker context.
 
 =cut
 
@@ -276,7 +277,8 @@ sub qemu_img_resize {
     push $cmd->@*, "--preallocation=$preallocation" if $preallocation;
     push $cmd->@*, '-f', $format, $path, $size;
 
-    $timeout = 10 if !$timeout;
+    $timeout = PVE::RPCEnvironment->is_worker() ? 60 * 60 : 10
+        if !$timeout;
     run_command($cmd, timeout => $timeout);
 }
 
-- 
2.47.3




  parent reply	other threads:[~2026-08-11  7:38 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-11  7:37 [PATCH storage v3 0/2] fix #7598: qemu-img: increase timeout for image resize Jakob Klocker
2026-08-11  7:37 ` [PATCH pve-storage v3 1/2] qemu-img: drop redundant timeout argument at resize call Jakob Klocker
2026-08-13  9:04   ` Elias Huhsovitz
2026-08-11  7:37 ` Jakob Klocker [this message]
2026-08-13  9:06   ` [PATCH pve-storage v3 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=20260811073740.100398-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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal