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