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 ABE941FF0C0 for ; Wed, 18 Nov 2026 15:47:01 +0100 (CET) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id 99D272195A; Wed, 18 Nov 2026 15:45:30 +0100 (CET) From: Daniel Kral To: pve-devel@lists.proxmox.com Subject: [PATCH ha-manager v4 16/17] lrm: resource_command_finished: avoid writing stale LRM results Date: Wed, 18 Nov 2026 15:45:01 +0100 Message-ID: <20261118144502.231134-17-d.kral@proxmox.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20261118144502.231134-1-d.kral@proxmox.com> References: <20261118144502.231134-1-d.kral@proxmox.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1795013119729 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.464 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: DEYMKH277SUZ4WTWWVORZC7X7ACILQ2I X-Message-ID-Hash: DEYMKH277SUZ4WTWWVORZC7X7ACILQ2I 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 Reviewed-by: Michael Köppl Tested-by: Michael Köppl --- 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 0dae360b..3afac344 100644 --- a/src/PVE/HA/LRM.pm +++ b/src/PVE/HA/LRM.pm @@ -912,6 +912,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