gen_leader receiving 2 handle_DOWN messages when the leader dies in a 2-process setup

Garret Smith garret.smith@REDACTED
Fri Jan 21 19:23:21 CET 2011


I'm using the latest gen_leader from
https://github.com/abecciu/gen_leader_revival.git

When the number of candidates is down to 2, 1 candidate and 1 leader,
and the leader dies, the last candidate receives 2 handle_DOWN
messages with the same Node parameter.

I have tried this starting with 3 candidates or 2 candidates.  In
either case, killing the leader when there are 2 candidates alive will
generate 2 handle_DOWN callbacks on the survivor with the same Node
parameter.
The callback order on the last node alive is:

elected(state, Elected, Node = undefined)
handle_DOWN()
handle_DOWN()

Is this expected behavior?  If so, what is the reason for 2
handle_DOWN callbacks?  If not, I'll be happy to provide a lot more
details on what I'm seeing.

Thanks,
Garret Smith


More information about the erlang-questions mailing list