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