Program: 130747
Project: 130747
Buggy source:
/** 
 * Entering broadcasting phase.
 * @throws InterruptedException if it's interrupted.
 * @throws TimeoutException  in case of timeout.
 * @throws IOException in case of IOException.
 * @throws ExecutionException in case of exception from executors.
 */
void accepting() throws TimeoutException, InterruptedException, IOException, ExecutionException {
  ClusterConfiguration clusterConfig=persistence.getLastSeenConfig();
  SyncProposalProcessor syncProcessor=new SyncProposalProcessor(persistence,transport,SYNC_MAX_BATCH_SIZE);
  CommitProcessor commitProcessor=new CommitProcessor(stateMachine,lastDeliveredZxid,serverId,transport,null,clusterConfig,electedLeader,semPendingReqs);
  SnapshotProcessor snapProcessor=new SnapshotProcessor(stateMachine,persistence);
  long lastHeartbeatTime=System.nanoTime();
  long ackEpoch=persistence.getAckEpoch();
  stateMachine.following(electedLeader,new HashSet<String>(clusterConfig.getPeers()));
  try {
    while (true) {
      MessageTuple tuple=getMessage();
      Message msg=tuple.getMessage();
      String source=tuple.getServerId();
      if (source.equals(this.electedLeader)) {
        lastHeartbeatTime=System.nanoTime();
      }
 else {
        long timeDiff=(System.nanoTime() - lastHeartbeatTime) / 1000000;
        if ((int)timeDiff >= this.config.getTimeoutMs()) {
          LOG.warn("String_Node_Str" + "String_Node_Str",this.electedLeader);
          throw new TimeoutException("String_Node_Str");
        }
        if (msg.getType() == MessageType.QUERY_LEADER) {
          LOG.debug("String_Node_Str",source);
          Message reply=MessageBuilder.buildQueryReply(this.electedLeader);
          sendMessage(source,reply);
        }
 else {
          LOG.debug("String_Node_Str",source);
        }
        continue;
      }
      if (msg.getType() != MessageType.HEARTBEAT && LOG.isDebugEnabled()) {
        LOG.debug("String_Node_Str",TextFormat.shortDebugString(msg),source);
      }
      if (msg.getType() == MessageType.PROPOSAL) {
        Transaction txn=MessageBuilder.fromProposal(msg.getProposal());
        Zxid zxid=txn.getZxid();
        if (zxid.getEpoch() == ackEpoch) {
          syncProcessor.processRequest(tuple);
          commitProcessor.processRequest(tuple);
        }
 else {
          LOG.debug("String_Node_Str",zxid.getEpoch(),ackEpoch);
          throw new RuntimeException("String_Node_Str");
        }
      }
 else       if (msg.getType() == MessageType.COMMIT) {
        commitProcessor.processRequest(tuple);
      }
 else       if (msg.getType() == MessageType.HEARTBEAT) {
        LOG.trace("String_Node_Str",source);
        Message heartbeatReply=MessageBuilder.buildHeartbeat();
        sendMessage(source,heartbeatReply);
      }
 else       if (msg.getType() == MessageType.DELIVERED) {
        onDelivered(msg,snapProcessor);
      }
 else       if (msg.getType() == MessageType.FLUSH) {
        onFlush(tuple,commitProcessor);
      }
 else {
        if (LOG.isWarnEnabled()) {
          LOG.warn("String_Node_Str",TextFormat.shortDebugString(msg),source);
        }
      }
    }
  }
  finally {
    commitProcessor.shutdown();
    syncProcessor.shutdown();
    snapProcessor.shutdown();
    this.lastDeliveredZxid=commitProcessor.getLastDeliveredZxid();
    this.participantState.updateLastDeliveredZxid(this.lastDeliveredZxid);
  }
}

Fixed version (ground truth):
/** 
 * Entering broadcasting phase.
 * @throws InterruptedException if it's interrupted.
 * @throws TimeoutException  in case of timeout.
 * @throws IOException in case of IOException.
 * @throws ExecutionException in case of exception from executors.
 */
void accepting() throws TimeoutException, InterruptedException, IOException, ExecutionException {
  ClusterConfiguration clusterConfig=persistence.getLastSeenConfig();
  SyncProposalProcessor syncProcessor=new SyncProposalProcessor(persistence,transport,SYNC_MAX_BATCH_SIZE);
  CommitProcessor commitProcessor=new CommitProcessor(stateMachine,lastDeliveredZxid,serverId,transport,null,clusterConfig,electedLeader,semPendingReqs);
  SnapshotProcessor snapProcessor=new SnapshotProcessor(stateMachine,persistence);
  long lastHeartbeatTime=System.nanoTime();
  long ackEpoch=persistence.getAckEpoch();
  stateMachine.following(electedLeader,new HashSet<String>(clusterConfig.getPeers()));
  try {
    while (true) {
      MessageTuple tuple=getMessage();
      Message msg=tuple.getMessage();
      String source=tuple.getServerId();
      if (source.equals(this.electedLeader)) {
        lastHeartbeatTime=System.nanoTime();
      }
 else {
        long timeDiff=(System.nanoTime() - lastHeartbeatTime) / 1000000;
        if ((int)timeDiff >= this.config.getTimeoutMs()) {
          LOG.warn("String_Node_Str" + "String_Node_Str",this.electedLeader);
          throw new TimeoutException("String_Node_Str");
        }
        if (msg.getType() == MessageType.QUERY_LEADER) {
          LOG.debug("String_Node_Str",source);
          Message reply=MessageBuilder.buildQueryReply(this.electedLeader);
          sendMessage(source,reply);
        }
 else         if (msg.getType() == MessageType.ELECTION_INFO) {
          this.election.reply(tuple);
        }
 else {
          LOG.debug("String_Node_Str",source);
        }
        continue;
      }
      if (msg.getType() != MessageType.HEARTBEAT && LOG.isDebugEnabled()) {
        LOG.debug("String_Node_Str",TextFormat.shortDebugString(msg),source);
      }
      if (msg.getType() == MessageType.PROPOSAL) {
        Transaction txn=MessageBuilder.fromProposal(msg.getProposal());
        Zxid zxid=txn.getZxid();
        if (zxid.getEpoch() == ackEpoch) {
          syncProcessor.processRequest(tuple);
          commitProcessor.processRequest(tuple);
        }
 else {
          LOG.debug("String_Node_Str",zxid.getEpoch(),ackEpoch);
          throw new RuntimeException("String_Node_Str");
        }
      }
 else       if (msg.getType() == MessageType.COMMIT) {
        commitProcessor.processRequest(tuple);
      }
 else       if (msg.getType() == MessageType.HEARTBEAT) {
        LOG.trace("String_Node_Str",source);
        Message heartbeatReply=MessageBuilder.buildHeartbeat();
        sendMessage(source,heartbeatReply);
      }
 else       if (msg.getType() == MessageType.DELIVERED) {
        onDelivered(msg,snapProcessor);
      }
 else       if (msg.getType() == MessageType.FLUSH) {
        onFlush(tuple,commitProcessor);
      }
 else {
        if (LOG.isWarnEnabled()) {
          LOG.warn("String_Node_Str",TextFormat.shortDebugString(msg),source);
        }
      }
    }
  }
  finally {
    commitProcessor.shutdown();
    syncProcessor.shutdown();
    snapProcessor.shutdown();
    this.lastDeliveredZxid=commitProcessor.getLastDeliveredZxid();
    this.participantState.updateLastDeliveredZxid(this.lastDeliveredZxid);
  }
}