File bsc#1181744-0002-Fix-controld-fencing-remove-notifications-upon-conne.patch of Package pacemaker.26124

From a0bc0d3ab5aed64e37b1caae746f5c421696df1b Mon Sep 17 00:00:00 2001
From: Klaus Wenninger <klaus.wenninger@aon.at>
Date: Fri, 14 Jun 2019 13:41:43 +0200
Subject: [PATCH 2/7] Fix: controld-fencing: remove-notifications upon
 connection-destroy

---
 daemons/controld/controld_te_utils.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

Index: pacemaker-2.0.1+20190417.13d370ca9/daemons/controld/controld_te_utils.c
===================================================================
--- pacemaker-2.0.1+20190417.13d370ca9.orig/daemons/controld/controld_te_utils.c
+++ pacemaker-2.0.1+20190417.13d370ca9/daemons/controld/controld_te_utils.c
@@ -173,7 +173,14 @@ tengine_stonith_connection_destroy(stoni
 
     /* cbchan will be garbage at this point, arrange for it to be reset */
     if(stonith_api) {
-        stonith_api->state = stonith_disconnected;
+        /* the client API won't properly reconnect notifications
+         * if they are still in the table - so remove them
+         */
+        stonith_api->cmds->remove_notification(st, T_STONITH_NOTIFY_DISCONNECT);
+        stonith_api->cmds->remove_notification(st, T_STONITH_NOTIFY_FENCE);
+        if (stonith_api->state != stonith_disconnected) {
+            stonith_api->cmds->disconnect(st);
+        }
     }
 
     if (AM_I_DC) {
openSUSE Build Service is sponsored by