فهرست منبع

votequorum: Report errors from votequorum_exec_send_reconfigure

If votequorum_exec_send_reconfigure() returns an error (ie the
packet could not be sent) then we should either return it to the
sender (for a library call) or, for an internal call, log it.

Signed-off-by: Christine Caulfield <ccaulfie@redhat.com>
Reviewed-by: Jan Friesse <jfriesse@redhat.com>
Christine Caulfield 8 سال پیش
والد
کامیت
5b1df51aa6
1فایلهای تغییر یافته به همراه20 افزوده شده و 10 حذف شده
  1. 20 10
      exec/votequorum.c

+ 20 - 10
exec/votequorum.c

@@ -1558,8 +1558,10 @@ static void votequorum_refresh_config(
 	if (strcmp(key_name, "quorum.cancel_wait_for_all") == 0 &&
 	if (strcmp(key_name, "quorum.cancel_wait_for_all") == 0 &&
 	    cancel_wfa >= 1) {
 	    cancel_wfa >= 1) {
 	        icmap_set_uint8("quorum.cancel_wait_for_all", 0);
 	        icmap_set_uint8("quorum.cancel_wait_for_all", 0);
-		votequorum_exec_send_reconfigure(VOTEQUORUM_RECONFIG_PARAM_CANCEL_WFA,
-						 us->node_id, 0);
+		if (votequorum_exec_send_reconfigure(VOTEQUORUM_RECONFIG_PARAM_CANCEL_WFA,
+						     us->node_id, 0)) {
+			log_printf(LOGSYS_LEVEL_ERROR, "Failed to send Cancel WFA message to other nodes");
+		}
 		return;
 		return;
 	}
 	}
 
 
@@ -1577,12 +1579,16 @@ static void votequorum_refresh_config(
 	votequorum_exec_send_nodeinfo(us->node_id);
 	votequorum_exec_send_nodeinfo(us->node_id);
 	votequorum_exec_send_nodeinfo(VOTEQUORUM_QDEVICE_NODEID);
 	votequorum_exec_send_nodeinfo(VOTEQUORUM_QDEVICE_NODEID);
 	if (us->votes != old_votes) {
 	if (us->votes != old_votes) {
-		votequorum_exec_send_reconfigure(VOTEQUORUM_RECONFIG_PARAM_NODE_VOTES,
-						 us->node_id, us->votes);
+		if (votequorum_exec_send_reconfigure(VOTEQUORUM_RECONFIG_PARAM_NODE_VOTES,
+						     us->node_id, us->votes)) {
+			log_printf(LOGSYS_LEVEL_ERROR, "Failed to send new votes message to other nodes");
+		}
 	}
 	}
 	if (us->expected_votes != old_expected_votes) {
 	if (us->expected_votes != old_expected_votes) {
-		votequorum_exec_send_reconfigure(VOTEQUORUM_RECONFIG_PARAM_EXPECTED_VOTES,
-						 us->node_id, us->expected_votes);
+		if (votequorum_exec_send_reconfigure(VOTEQUORUM_RECONFIG_PARAM_EXPECTED_VOTES,
+						     us->node_id, us->expected_votes)) {
+			log_printf(LOGSYS_LEVEL_ERROR, "Failed to send expected votes message to other nodes");
+		}
 	}
 	}
 
 
 	LEAVE();
 	LEAVE();
@@ -2654,8 +2660,10 @@ static void message_handler_req_lib_votequorum_setexpected (void *conn, const vo
 	}
 	}
 	update_node_expected_votes(req_lib_votequorum_setexpected->expected_votes);
 	update_node_expected_votes(req_lib_votequorum_setexpected->expected_votes);
 
 
-	votequorum_exec_send_reconfigure(VOTEQUORUM_RECONFIG_PARAM_EXPECTED_VOTES, us->node_id,
-					 req_lib_votequorum_setexpected->expected_votes);
+	if (votequorum_exec_send_reconfigure(VOTEQUORUM_RECONFIG_PARAM_EXPECTED_VOTES, us->node_id,
+					     req_lib_votequorum_setexpected->expected_votes)) {
+		error = CS_ERR_NO_RESOURCES;
+	}
 
 
 error_exit:
 error_exit:
 	res_lib_votequorum_status.header.size = sizeof(res_lib_votequorum_status);
 	res_lib_votequorum_status.header.size = sizeof(res_lib_votequorum_status);
@@ -2701,8 +2709,10 @@ static void message_handler_req_lib_votequorum_setvotes (void *conn, const void
 		goto error_exit;
 		goto error_exit;
 	}
 	}
 
 
-	votequorum_exec_send_reconfigure(VOTEQUORUM_RECONFIG_PARAM_NODE_VOTES, nodeid,
-					 req_lib_votequorum_setvotes->votes);
+	if (votequorum_exec_send_reconfigure(VOTEQUORUM_RECONFIG_PARAM_NODE_VOTES, nodeid,
+					     req_lib_votequorum_setvotes->votes)) {
+		error = CS_ERR_NO_RESOURCES;
+	}
 
 
 error_exit:
 error_exit:
 	res_lib_votequorum_status.header.size = sizeof(res_lib_votequorum_status);
 	res_lib_votequorum_status.header.size = sizeof(res_lib_votequorum_status);