// The latter is preferable since it makes it easier to reason about the state of an
// announced scheduler.
delayedActions.onRegistered(new Runnable() {
@Override
public void run() {
eventSink.post(new SchedulerActive());
try {
leaderControl.get().advertise();
} catch (JoinException e) {
LOG.log(Level.SEVERE, "Failed to advertise leader, shutting down.", e);
stateMachine.transition(State.DEAD);