From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gate001.proxmox.com (gate001.proxmox.com [45.144.208.40]) by lore.proxmox.com (Postfix) with ESMTPS id 266481FF0E3 for ; Tue, 04 Aug 2026 11:04:44 +0200 (CEST) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id DFD3321583; Tue, 04 Aug 2026 11:04:43 +0200 (CEST) From: Jakob Klocker To: pve-devel@lists.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 Message-ID: <20260804090438.58491-3-j.klocker@proxmox.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260804090438.58491-1-j.klocker@proxmox.com> References: <20260804090438.58491-1-j.klocker@proxmox.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SPAM-LEVEL: Spam detection results: 1 AWL -0.553 Adjusted score from AWL reputation of From: address DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment (newer systems) KAM_LAZY_DOMAIN_SECURITY 1 Sending domain does not have any anti-forgery methods RDNS_NONE 1.274 Delivered to internal network by a host with no rDNS SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_NONE 0.001 SPF: sender does not publish an SPF Record Message-ID-Hash: QM7R5ZZIDXNHXP4GVNUKGDVAJD2MHZUV X-Message-ID-Hash: QM7R5ZZIDXNHXP4GVNUKGDVAJD2MHZUV X-MailFrom: jklocker@dev.proxmox.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Jakob Klocker X-Mailman-Version: 3.3.10 Precedence: list List-Id: Proxmox VE development discussion List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: 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 --- 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