Skip to content

Commit

Permalink
clusterer: fix deadlock when receiving clusterer_reload via cluster
Browse files Browse the repository at this point in the history
Running cluster_send_mi or cluster_broadcast_mi with clusterer_reload
as the command to dispatch would cause a deadlock on the receiving nodes.
  • Loading branch information
rvlad-patrascu committed Jul 4, 2023
1 parent 9eb13bf commit aa8e5ff
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion modules/clusterer/clusterer.c
Original file line number Diff line number Diff line change
Expand Up @@ -1107,8 +1107,13 @@ void bin_rcv_cl_extra_packets(bin_packet_t *packet, int packet_type,
handle_remove_node(packet, cl);
else if (packet_type == CLUSTERER_GENERIC_MSG)
handle_cl_gen_msg(packet, cluster_id, source_id);
else if (packet_type == CLUSTERER_MI_CMD)
else if (packet_type == CLUSTERER_MI_CMD) {
/* we don't need to hold the lock while running an MI cmd, and in
* case of clusterer's own cmds, it might even cause a deadlock */
lock_stop_read(cl_list_lock);
handle_cl_mi_msg(packet);
return;
}
else if (packet_type == CLUSTERER_SHTAG_ACTIVE)
handle_shtag_active(packet, cluster_id, source_id);
else if (packet_type == CLUSTERER_SYNC_REQ)
Expand Down

0 comments on commit aa8e5ff

Please sign in to comment.