提交 83ffe256 编写于 作者: C ChaosguardX

Fixed a bug in ExecutionManager.java where not all stoppedMsgs would be...

Fixed a bug in ExecutionManager.java where not all stoppedMsgs would be removed from the List upon restart
上级 1184efc9
......@@ -23,7 +23,7 @@ import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.Queue;
import java.util.TreeMap;
import java.util.concurrent.locks.ReentrantLock;
......@@ -68,7 +68,7 @@ public final class ExecutionManager {
private boolean stopped = false; // Is the execution manager stopped?
// When the execution manager is stopped, incoming paxos messages are stored here
private List<PaxosMessage> stoppedMsgs = new LinkedList<PaxosMessage>();
private Queue<PaxosMessage> stoppedMsgs = new LinkedList<PaxosMessage>();
private Round stoppedRound = null; // round at which the current execution was stoppped
private ReentrantLock stoppedMsgsLock = new ReentrantLock(); //lock for stopped messages
......@@ -207,8 +207,8 @@ public final class ExecutionManager {
}*/
//process stopped messages
for (int i = 0; i < stoppedMsgs.size(); i++) {
acceptor.processMessage(stoppedMsgs.remove(i));
while(!stoppedMsgs.isEmpty()){
acceptor.processMessage(stoppedMsgs.remove());
}
stoppedMsgsLock.unlock();
Logger.println("(ExecutionManager.restart) Finished stopped messages processing");
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册