When providing a custom executor to the leader selector it creates a thread that waits for leadership.
When it has leadership, it submits a runnable to the custom executor and then release leadership.
If the executor is is e.g. a ThreadPoolExecutor, the takeLeadership method is executed asynchrounously, after releasing leadership.
Is this a bug or am I missing the point of using my own executor?
I have attached an example which shows multiple leaders being elected at the same time.
(The example uses curator 1.3.3, but I think it is the same in 2.x)