Description
I haven't tested this yet, so I could be wrong, but this is my reading of the code:
During init:
ElectionContext context = new OverseerElectionContext(zkClient, overseer, getNodeName()); overseerElector.setup(context); overseerElector.joinElection(context, false);
On reconnect:
ElectionContext context = new OverseerElectionContext(zkClient,overseer, getNodeName()); ElectionContext prevContext = overseerElector.getContext(); if (prevContext != null) { prevContext.cancelElection(); } overseerElector.joinElection(context, true);
setup doesn't appear to be called on reconnect, so the new context is never set and the first context gets cancelled over and over.
A call to overseerElector.setup(context); before joinElection in the reconnect case would address this.