Hotfix
Fix current_state processing
@@ -1422,6 +1422,9 @@ class Node(HasActionQueue, Motor, Propagator, MessageProcessor, HasFileStorage,
return False
return True
+ def _should_accept_current_state(self):
+ return self.viewNo == 0 and self.mode == Mode.starting and self.master_primary_name is None
+
def msgHasAcceptableViewNo(self, msg, frm, from_current_state: bool = False) -> bool:
"""
Return true if the view no of message corresponds to the current view
@@ -1436,7 +1439,7 @@ class Node(HasActionQueue, Motor, Propagator, MessageProcessor, HasFileStorage,
if self.viewNo - view_no > 1:
self.discard(msg, "un-acceptable viewNo {}"
.format(view_no), logMethod=logger.warning)
- elif (view_no > self.viewNo) or (self.viewNo == 0 and from_current_state):
+ elif (view_no > self.viewNo) or (from_current_state and self._should_accept_current_state()):
if view_no not in self.msgsForFutureViews:
self.msgsForFutureViews[view_no] = deque()
logger.info('{} stashing a message for a future view: {}'.
