From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gate001.proxmox.com (gate001.proxmox.com [IPv6:2a0f:8001:1:32::40]) by lore.proxmox.com (Postfix) with ESMTPS id 1B4731FF0B6 for ; Thu, 12 Nov 2026 17:33:45 +0100 (CET) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id 83D992182A; Thu, 12 Nov 2026 17:32:17 +0100 (CET) From: Daniel Kral To: pve-devel@lists.proxmox.com Subject: [PATCH ha-manager v2 15/16] lrm: resource_command_finished: avoid writing stale LRM results Date: Thu, 12 Nov 2026 17:31:14 +0100 Message-ID: <20261112163113.294302-18-d.kral@proxmox.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20261112163113.294302-3-d.kral@proxmox.com> References: <20261112163113.294302-3-d.kral@proxmox.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1794501128418 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.607 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) RCVD_IN_DNSWL_MED -2.3 Sender listed at https://www.dnswl.org/, medium trust SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Message-ID-Hash: VDCPPCGLBDWPS67WMD2RCCFFBTB2DKQW X-Message-ID-Hash: VDCPPCGLBDWPS67WMD2RCCFFBTB2DKQW X-MailFrom: d.kral@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 X-Mailman-Version: 3.3.10 Precedence: list List-Id: Proxmox VE development discussion List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: resource_command_finished() is called whenever an HA resource command finishes, which was previously queued by queue_resource_command(). However, if the HA resource command uid became stale in the meantime, i.e. the HA Manager dropped or renewed an HA resource's uid, the LRM results would be written to $self->{results} and pruned right after. Therefore, do not write it to $self->{results} at all. Signed-off-by: Daniel Kral --- src/PVE/HA/LRM.pm | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/PVE/HA/LRM.pm b/src/PVE/HA/LRM.pm index 91a3e1b9..28a1fd56 100644 --- a/src/PVE/HA/LRM.pm +++ b/src/PVE/HA/LRM.pm @@ -904,6 +904,9 @@ sub resource_command_finished { return if $exit_code == ETRY_AGAIN; # tell nobody, simply retry + # do not report the result as the resource command uid is already stale + return if !$self->{service_status_uids}->{$uid}; + $self->{results}->{$uid} = { sid => $w->{sid}, state => $w->{state}, -- 2.47.3