File bug-1053463_pacemaker-liblrmd-make-sure-operation-of-remote-resource-returns.patch of Package pacemaker.9287
From 993c57ba5bd3df64d57f05a75cb34e51a7a604cc Mon Sep 17 00:00:00 2001
From: "Gao,Yan" <ygao@suse.com>
Date: Tue, 22 Aug 2017 12:20:02 +0200
Subject: [PATCH] Fix: liblrmd: Make sure the operation of a remote resource
returns if setup of the key fails
Previously, if the operation of a remote resource failed on setting up
the key, it'd become forever in-flight operation and never return.
---
lib/lrmd/lrmd_client.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/lib/lrmd/lrmd_client.c b/lib/lrmd/lrmd_client.c
index 72aacb7de9..5c99e74a16 100644
--- a/lib/lrmd/lrmd_client.c
+++ b/lib/lrmd/lrmd_client.c
@@ -1154,8 +1154,12 @@ lrmd_tcp_connect_cb(void *userdata, int sock)
* to avoid all blocking code in the client. */
native->sock = sock;
- if (lrmd_tls_set_key(&psk_key) != 0) {
+ rc = lrmd_tls_set_key(&psk_key);
+ if (rc != 0) {
+ crm_warn("Setup of the key failed (rc=%d) for remote node %s:%d",
+ rc, native->server, native->port);
lrmd_tls_connection_destroy(lrmd);
+ report_async_connection_result(lrmd, rc);
return;
}