mirror of
https://git.proxmox.com/git/mirror_corosync
synced 2025-07-27 09:22:03 +00:00
CPG: Send CPG_REASON_PROCDOWN when really needed
This patch fixes the issue that in some cases where cpg_finalize() was called just after cpg_leave() was called, CPG_REASON_PROCDOWN might also be sent while CPG_REASON_LEAVE had already been sent. This behavior is not aligned with what the man page has described: "CPG_REASON_PROCDOWN - the process left a group without calling cpg_leave()." And it will confuse CPG's clients in that one process left results in two different reasons being sent. The root cause of this issue is cpg_leave() will return after adding the LEAVE message to the sending queue, but the cpg's group name has not been cleared yet. Just at that time, cpg_finalize() is being called, then it determines if there is the calling of cpg_leave() happened only by the checking of cpg's group name, so this method is not sufficient. Signed-off-by: Jiaju Zhang <jjzhang@suse.de> Reviewed-by: Steven Dake <sdake@redhat.com>
This commit is contained in:
parent
9fa86486e9
commit
dd9e177af7
@ -920,7 +920,7 @@ static int cpg_lib_exit_fn (void *conn)
|
||||
|
||||
log_printf(LOGSYS_LEVEL_DEBUG, "exit_fn for conn=%p", conn);
|
||||
|
||||
if (cpd->group_name.length > 0) {
|
||||
if (cpd->group_name.length > 0 && cpd->cpd_state != CPD_STATE_LEAVE_STARTED) {
|
||||
cpg_node_joinleave_send (cpd->pid, &cpd->group_name,
|
||||
MESSAGE_REQ_EXEC_CPG_PROCLEAVE, CONFCHG_CPG_REASON_PROCDOWN);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user