summary |
shortlog |
log |
commit | commitdiff |
review |
tree
raw |
patch |
inline | side by side (from parent 1:
89894f5)
Rather than dying when requested to shutdown in pre-leader state,
follow the same code path we perform in normal leader mode, i.e.
transfer leadership.
Change-Id: I2ca30d44626df05c5f8b5ff6984eea20c7bf0949
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
shuttingDown = true;
final RaftActorBehavior currentBehavior = context.getCurrentBehavior();
shuttingDown = true;
final RaftActorBehavior currentBehavior = context.getCurrentBehavior();
- if (currentBehavior.state() != RaftState.Leader) {
- // For non-leaders shutdown is a no-op
- self().tell(PoisonPill.getInstance(), self());
- return;
+ switch (currentBehavior.state()) {
+ case Leader:
+ case PreLeader:
+ // Fall-through to more work
+ break;
+ default:
+ // For non-leaders shutdown is a no-op
+ self().tell(PoisonPill.getInstance(), self());
+ return;
}
if (context.hasFollowers()) {
}
if (context.hasFollowers()) {