64302d
From d8e08729ad5e3dc62f774172f992210902fc0ed4 Mon Sep 17 00:00:00 2001
64302d
From: Ken Gaillot <kgaillot@redhat.com>
64302d
Date: Mon, 23 Jan 2023 14:25:56 -0600
64302d
Subject: [PATCH] High: executor: fix regression in remote node shutdown
64302d
64302d
This reverts the essential part of d61494347, which was based on misdiagnosing
64302d
a remote node shutdown issue. Initially, it was thought that a "TLS server
64302d
session ended" log just after a remote node requested shutdown indicated that
64302d
the proxy connection coincidentally dropped at that moment. It actually is the
64302d
routine stopping of accepting new proxy connections, and existing when that
64302d
happens makes the remote node exit immediately without waiting for the
64302d
all-clear from the cluster.
64302d
64302d
Fixes T361
64302d
---
64302d
 daemons/execd/pacemaker-execd.c | 19 +------------------
64302d
 daemons/execd/pacemaker-execd.h |  3 +--
64302d
 daemons/execd/remoted_tls.c     |  6 +-----
64302d
 3 files changed, 3 insertions(+), 25 deletions(-)
64302d
64302d
diff --git a/daemons/execd/pacemaker-execd.c b/daemons/execd/pacemaker-execd.c
64302d
index db12674f13..491808974a 100644
64302d
--- a/daemons/execd/pacemaker-execd.c
64302d
+++ b/daemons/execd/pacemaker-execd.c
64302d
@@ -1,5 +1,5 @@
64302d
 /*
64302d
- * Copyright 2012-2022 the Pacemaker project contributors
64302d
+ * Copyright 2012-2023 the Pacemaker project contributors
64302d
  *
64302d
  * The version control history for this file may have further details.
64302d
  *
64302d
@@ -305,23 +305,6 @@ lrmd_exit(gpointer data)
64302d
     return FALSE;
64302d
 }
64302d
 
64302d
-/*!
64302d
- * \internal
64302d
- * \brief Clean up and exit if shutdown has started
64302d
- *
64302d
- * \return Doesn't return
64302d
- */
64302d
-void
64302d
-execd_exit_if_shutting_down(void)
64302d
-{
64302d
-#ifdef PCMK__COMPILE_REMOTE
64302d
-    if (shutting_down) {
64302d
-        crm_warn("exit because TLS connection was closed and 'shutting_down' set");
64302d
-        lrmd_exit(NULL);
64302d
-    }
64302d
-#endif
64302d
-}
64302d
-
64302d
 /*!
64302d
  * \internal
64302d
  * \brief Request cluster shutdown if appropriate, otherwise exit immediately
64302d
diff --git a/daemons/execd/pacemaker-execd.h b/daemons/execd/pacemaker-execd.h
64302d
index 6646ae29e3..f78e8dcdde 100644
64302d
--- a/daemons/execd/pacemaker-execd.h
64302d
+++ b/daemons/execd/pacemaker-execd.h
64302d
@@ -1,5 +1,5 @@
64302d
 /*
64302d
- * Copyright 2012-2022 the Pacemaker project contributors
64302d
+ * Copyright 2012-2023 the Pacemaker project contributors
64302d
  *
64302d
  * The version control history for this file may have further details.
64302d
  *
64302d
@@ -105,6 +105,5 @@ void remoted_spawn_pidone(int argc, char **argv, char **envp);
64302d
 int process_lrmd_alert_exec(pcmk__client_t *client, uint32_t id,
64302d
                             xmlNode *request);
64302d
 void lrmd_drain_alerts(GMainLoop *mloop);
64302d
-void execd_exit_if_shutting_down(void);
64302d
 
64302d
 #endif // PACEMAKER_EXECD__H
64302d
diff --git a/daemons/execd/remoted_tls.c b/daemons/execd/remoted_tls.c
64302d
index 6f4b2d0062..c65e3f394d 100644
64302d
--- a/daemons/execd/remoted_tls.c
64302d
+++ b/daemons/execd/remoted_tls.c
64302d
@@ -1,5 +1,5 @@
64302d
 /*
64302d
- * Copyright 2012-2022 the Pacemaker project contributors
64302d
+ * Copyright 2012-2023 the Pacemaker project contributors
64302d
  *
64302d
  * The version control history for this file may have further details.
64302d
  *
64302d
@@ -250,10 +250,6 @@ static void
64302d
 tls_server_dropped(gpointer user_data)
64302d
 {
64302d
     crm_notice("TLS server session ended");
64302d
-    /* If we are in the process of shutting down, then we should actually exit.
64302d
-     * bz#1804259
64302d
-     */
64302d
-    execd_exit_if_shutting_down();
64302d
     return;
64302d
 }
64302d
 
64302d
-- 
64302d
2.31.1
64302d