add unstashing to VCStartMsgStrategy complete
@@ -65,6 +65,8 @@ class VCStartMsgStrategy(PreViewChangeStrategy):
self.is_preparing = True
def on_strategy_complete(self):
+ logger.info("VCStartMsgStrategy: on_strategy_complete - View Change can be started")
+ self.unstash_messages()
self.is_preparing = False
@staticmethod
@@ -111,13 +113,16 @@ class VCStartMsgStrategy(PreViewChangeStrategy):
Return stashed not 3PC msgs to nodeInBox queue and start ViewChange
Critical assumption: All 3PC msgs passed from node already processed
"""
- replica.logger.info("VCStartMsgStrategy: unstash all not 3PC msgs to nodeInBox queue")
- while strategy.stashedNodeInBox:
- replica.node.nodeInBox.appendleft(strategy.stashedNodeInBox.pop())
+ strategy.unstash_messages()
replica.logger.info("VCStartMsgStrategy: continue view_change procedure in a normal way")
replica.node.view_changer.startViewChange(proposed_view_no, continue_vc=True)
strategy.is_preparing = False
+ def unstash_messages(self):
+ self.replica.logger.info("VCStartMsgStrategy: unstash all not 3PC msgs to nodeInBox queue")
+ while self.stashedNodeInBox:
+ self.replica.node.nodeInBox.appendleft(self.stashedNodeInBox.pop())
+
def _set_req_handlers(self):
node_msg_router = self.node.nodeMsgRouter
replica_msg_router = self.replica.inBoxRouter
