Solution: Start a new election - or reset the current one if it's still in progress - when a peer leaves
Not resetting the election when a peer leaves during a running election triggered a loop between zyre nodes resulting in endless JOIN/LEAVE messages being sent.
Now, the election AND the group leader (if any) is reset whenever a peer joins or leaves an election channel.
I also renamed some variables while trying to understand the election process and kept those names because I feel it eases the understanding of the code.
Solution: Start a new election - or reset the current one if it's still in progress - when a peer leaves
Not resetting the election when a peer leaves during a running election triggered a loop between zyre nodes resulting in endless JOIN/LEAVE messages being sent.
Now, the election AND the group leader (if any) is reset whenever a peer joins or leaves an election channel.
I also renamed some variables while trying to understand the election process and kept those names because I feel it eases the understanding of the code.