File pacemaker-crm_resource-wait-for-all-messages-before-exiting.patch of Package pacemaker.14737

commit e3b825a72037538bdb7b181bb39cabc3f121d0d4
Author: Andrew Beekhof <andrew@beekhof.net>
Date:   Sun Oct 29 16:33:13 2017 +1100

    Fix: crm_resource: Ensure we wait for all messages before exiting
    
    - Wait for deletions from remote nodes too
    - Only reset counter if it went backwards past zero
    - Start mainloop for the new --cleanup mode
    
    Terminating too early prevents our delete operations being read by the
    crmd process.

Index: pacemaker/tools/crm_resource_runtime.c
===================================================================
--- pacemaker.orig/tools/crm_resource_runtime.c
+++ pacemaker/tools/crm_resource_runtime.c
@@ -666,7 +666,10 @@ cli_resource_delete(cib_t *cib_conn, crm
             crm_trace("Processed mainloop input, %d still remaining",
                           crmd_replies_needed);
         }
-        crmd_replies_needed = 0;
+
+        if(crmd_replies_needed < 0) {
+            crmd_replies_needed = 0;
+        }
 
         if(is_not_set(rsc->flags, pe_rsc_unique)) {
             char *id = clone_strip(rsc->id);
openSUSE Build Service is sponsored by