File 0001-Fix-controller-don-t-try-to-execute-agent-action-at-.patch of Package pacemaker.38493

From 63f4bd4d5a324e6eb279340a42c7c36c8902ada7 Mon Sep 17 00:00:00 2001
From: Ken Gaillot <kgaillot@redhat.com>
Date: Wed, 2 Aug 2023 15:55:26 -0500
Subject: [PATCH] Fix: controller: don't try to execute agent action at
 shutdown

Normally, agent execution is not possible at shutdown. However, when metadata
is needed for some action, the agent can be called asynchronously, and when the
metadata action returns, the original action is performed. If the metadata is
initiated before shutdown, but completes after shutdown has begun, do not try
to attempt the original action, so we avoid unnecessary error logs.
---
 daemons/controld/controld_execd.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Index: pacemaker-2.1.5+20221208.a3f44794f/daemons/controld/controld_execd.c
===================================================================
--- pacemaker-2.1.5+20221208.a3f44794f.orig/daemons/controld/controld_execd.c
+++ pacemaker-2.1.5+20221208.a3f44794f/daemons/controld/controld_execd.c
@@ -1728,7 +1728,9 @@ metadata_complete(int pid, const pcmk__a
         md = controld_cache_metadata(lrm_state->metadata_cache, data->rsc,
                                      result->action_stdout);
     }
-    do_lrm_rsc_op(lrm_state, data->rsc, data->input_xml, md);
+    if (!pcmk_is_set(fsa_input_register, R_HA_DISCONNECTED)) {
+        do_lrm_rsc_op(lrm_state, data->rsc, data->input_xml, md);
+    }
     free_metadata_cb_data(data);
 }
 
openSUSE Build Service is sponsored by