Program: 130770
Project: 130770
Buggy source:
/** 
 * Entering broadcasting phase, leader broadcasts proposal to followers.
 * @throws InterruptedException if it's interrupted.
 * @throws TimeoutException in case of timeout.
 * @throws IOException in case of IO failure.
 * @throws ExecutionException in case of exception from executors.
 */
void broadcasting() throws TimeoutException, InterruptedException, IOException, ExecutionException {
  Zxid lastZxid=persistence.getLog().getLatestZxid();
  this.establishedEpoch=persistence.getAckEpoch();
  PeerHandler lh=new PeerHandler(serverId,transport,config.getTimeout() / 3);
  lh.setLastAckedZxid(lastZxid);
  lh.startBroadcastingTask();
  this.quorumSet.put(this.serverId,lh);
  ClusterConfiguration clusterConfig=persistence.getLastSeenConfig();
  PreProcessor preProcessor=new PreProcessor(stateMachine,quorumSet,clusterConfig.clone());
  AckProcessor ackProcessor=new AckProcessor(quorumSet,clusterConfig.clone(),lastZxid);
  SyncProposalProcessor syncProcessor=new SyncProposalProcessor(persistence,transport,SYNC_MAX_BATCH_SIZE);
  CommitProcessor commitProcessor=new CommitProcessor(stateMachine,lastDeliveredZxid,serverId,transport);
  stateMachine.clusterChange(new HashSet<String>(clusterConfig.getPeers()));
  notifyQuorumSetChange();
  SendRequestTask sendTask=new SendRequestTask(this.serverId);
  Zxid pendingCopZxid=null;
  this.lastCommittedZxid=lastZxid;
  this.lastProposedZxid=lastZxid;
  this.lastAckedZxid=lastZxid;
  try {
    while (this.quorumSet.size() >= 0) {
      MessageTuple tuple=getMessage();
      Message msg=tuple.getMessage();
      String source=tuple.getServerId();
      if (msg.getType() == MessageType.PROPOSED_EPOCH) {
        LOG.debug("String_Node_Str",source);
        ClusterConfiguration cnf=persistence.getLastSeenConfig();
        if (!cnf.contains(source)) {
          LOG.warn("String_Node_Str" + "String_Node_Str",source);
          continue;
        }
        Message newEpoch=MessageBuilder.buildNewEpochMessage(this.establishedEpoch);
        sendMessage(source,newEpoch);
      }
 else       if (msg.getType() == MessageType.ACK_EPOCH) {
        LOG.debug("String_Node_Str",source);
        tuple.setZxid(lastProposedZxid);
        onAckEpoch(tuple,preProcessor,ackProcessor);
      }
 else       if (msg.getType() == MessageType.QUERY_LEADER) {
        LOG.debug("String_Node_Str",source);
        Message reply=MessageBuilder.buildQueryReply(this.serverId);
        sendMessage(source,reply);
      }
 else       if (msg.getType() == MessageType.JOIN) {
        LOG.debug("String_Node_Str",source);
        if (pendingCopZxid != null) {
          LOG.warn("String_Node_Str");
          continue;
        }
        pendingCopZxid=getNextProposedZxid();
        tuple.setZxid(pendingCopZxid);
        onJoin(tuple,preProcessor,ackProcessor);
      }
 else {
        if (!this.quorumSet.containsKey(source)) {
          if (LOG.isDebugEnabled()) {
            LOG.debug("String_Node_Str",TextFormat.shortDebugString(msg),source);
          }
          continue;
        }
        if (msg.getType() != MessageType.HEARTBEAT && LOG.isDebugEnabled()) {
          LOG.debug("String_Node_Str",TextFormat.shortDebugString(msg),source);
        }
        if (msg.getType() == MessageType.ACK) {
          onAck(tuple,ackProcessor);
        }
 else         if (msg.getType() == MessageType.REQUEST) {
          tuple.setZxid(getNextProposedZxid());
          preProcessor.processRequest(tuple);
        }
 else         if (msg.getType() == MessageType.HEARTBEAT) {
          LOG.trace("String_Node_Str",source);
        }
 else         if (msg.getType() == MessageType.PROPOSAL) {
          syncProcessor.processRequest(tuple);
          commitProcessor.processRequest(tuple);
        }
 else         if (msg.getType() == MessageType.COMMIT) {
          lastCommittedZxid=MessageBuilder.fromProtoZxid(msg.getCommit().getZxid());
          if (pendingCopZxid != null && lastCommittedZxid.compareTo(pendingCopZxid) >= 0) {
            LOG.debug("String_Node_Str",pendingCopZxid);
            pendingCopZxid=null;
            if (stateChangeCallback != null) {
              stateChangeCallback.commitCop();
            }
          }
          onCommit(tuple,commitProcessor);
        }
 else         if (msg.getType() == MessageType.DISCONNECTED) {
          onDisconnected(tuple,preProcessor,ackProcessor);
        }
 else         if (msg.getType() == MessageType.REMOVE) {
          if (pendingCopZxid != null) {
            LOG.warn("String_Node_Str");
            continue;
          }
          pendingCopZxid=getNextProposedZxid();
          tuple.setZxid(pendingCopZxid);
          onRemove(tuple,preProcessor,ackProcessor);
        }
 else         if (msg.getType() == MessageType.SHUT_DOWN) {
          throw new LeftCluster("String_Node_Str");
        }
 else {
          if (LOG.isWarnEnabled()) {
            LOG.warn("String_Node_Str",TextFormat.shortDebugString(msg),source);
          }
        }
        PeerHandler ph=quorumSet.get(source);
        if (ph != null) {
          ph.updateHeartbeatTime();
        }
        checkFollowerLiveness();
      }
    }
    LOG.debug("String_Node_Str" + "String_Node_Str",getQuorumSize());
  }
  finally {
    sendTask.shutdown();
    ackProcessor.shutdown();
    preProcessor.shutdown();
    commitProcessor.shutdown();
    syncProcessor.shutdown();
    this.lastDeliveredZxid=commitProcessor.getLastDeliveredZxid();
    this.participantState.updateLastDeliveredZxid(this.lastDeliveredZxid);
  }
}

Fixed version (ground truth):
/** 
 * Entering broadcasting phase, leader broadcasts proposal to followers.
 * @throws InterruptedException if it's interrupted.
 * @throws TimeoutException in case of timeout.
 * @throws IOException in case of IO failure.
 * @throws ExecutionException in case of exception from executors.
 */
void broadcasting() throws TimeoutException, InterruptedException, IOException, ExecutionException {
  Zxid lastZxid=persistence.getLog().getLatestZxid();
  this.establishedEpoch=persistence.getAckEpoch();
  PeerHandler lh=new PeerHandler(serverId,transport,config.getTimeout() / 3);
  lh.setLastAckedZxid(lastZxid);
  lh.startBroadcastingTask();
  this.quorumSet.put(this.serverId,lh);
  ClusterConfiguration clusterConfig=persistence.getLastSeenConfig();
  PreProcessor preProcessor=new PreProcessor(stateMachine,quorumSet,clusterConfig.clone());
  AckProcessor ackProcessor=new AckProcessor(quorumSet,clusterConfig.clone(),lastZxid);
  SyncProposalProcessor syncProcessor=new SyncProposalProcessor(persistence,transport,SYNC_MAX_BATCH_SIZE);
  CommitProcessor commitProcessor=new CommitProcessor(stateMachine,lastDeliveredZxid,serverId,transport);
  stateMachine.clusterChange(new HashSet<String>(clusterConfig.getPeers()));
  notifyQuorumSetChange();
  SendRequestTask sendTask=new SendRequestTask(this.serverId);
  this.lastCommittedZxid=lastZxid;
  this.lastProposedZxid=lastZxid;
  this.lastAckedZxid=lastZxid;
  try {
    while (this.quorumSet.size() >= getQuorumSize()) {
      MessageTuple tuple=getMessage();
      Message msg=tuple.getMessage();
      String source=tuple.getServerId();
      if (msg.getType() == MessageType.PROPOSED_EPOCH) {
        LOG.debug("String_Node_Str",source);
        ClusterConfiguration cnf=persistence.getLastSeenConfig();
        if (!cnf.contains(source)) {
          LOG.warn("String_Node_Str" + "String_Node_Str",source);
          continue;
        }
        Message newEpoch=MessageBuilder.buildNewEpochMessage(this.establishedEpoch);
        sendMessage(source,newEpoch);
      }
 else       if (msg.getType() == MessageType.ACK_EPOCH) {
        LOG.debug("String_Node_Str",source);
        tuple.setZxid(lastProposedZxid);
        onAckEpoch(tuple,preProcessor,ackProcessor);
      }
 else       if (msg.getType() == MessageType.QUERY_LEADER) {
        LOG.debug("String_Node_Str",source);
        Message reply=MessageBuilder.buildQueryReply(this.serverId);
        sendMessage(source,reply);
      }
 else       if (msg.getType() == MessageType.JOIN) {
        LOG.debug("String_Node_Str",source);
        if (pendingCopZxid != null) {
          LOG.warn("String_Node_Str");
          continue;
        }
        pendingCopZxid=getNextProposedZxid();
        tuple.setZxid(pendingCopZxid);
        onJoin(tuple,preProcessor,ackProcessor);
      }
 else {
        if (!this.quorumSet.containsKey(source)) {
          if (LOG.isDebugEnabled()) {
            LOG.debug("String_Node_Str",TextFormat.shortDebugString(msg),source);
          }
          continue;
        }
        if (msg.getType() != MessageType.HEARTBEAT && LOG.isDebugEnabled()) {
          LOG.debug("String_Node_Str",TextFormat.shortDebugString(msg),source);
        }
        if (msg.getType() == MessageType.ACK) {
          onAck(tuple,ackProcessor);
        }
 else         if (msg.getType() == MessageType.REQUEST) {
          tuple.setZxid(getNextProposedZxid());
          preProcessor.processRequest(tuple);
        }
 else         if (msg.getType() == MessageType.HEARTBEAT) {
          LOG.trace("String_Node_Str",source);
        }
 else         if (msg.getType() == MessageType.PROPOSAL) {
          syncProcessor.processRequest(tuple);
          commitProcessor.processRequest(tuple);
        }
 else         if (msg.getType() == MessageType.COMMIT) {
          onCommit(tuple,commitProcessor);
        }
 else         if (msg.getType() == MessageType.DISCONNECTED) {
          onDisconnected(tuple,preProcessor,ackProcessor);
        }
 else         if (msg.getType() == MessageType.REMOVE) {
          if (pendingCopZxid != null) {
            LOG.warn("String_Node_Str");
            continue;
          }
          pendingCopZxid=getNextProposedZxid();
          tuple.setZxid(pendingCopZxid);
          onRemove(tuple,preProcessor,ackProcessor);
        }
 else         if (msg.getType() == MessageType.SHUT_DOWN) {
          throw new LeftCluster("String_Node_Str");
        }
 else {
          if (LOG.isWarnEnabled()) {
            LOG.warn("String_Node_Str",TextFormat.shortDebugString(msg),source);
          }
        }
        PeerHandler ph=quorumSet.get(source);
        if (ph != null) {
          ph.updateHeartbeatTime();
        }
        checkFollowerLiveness();
      }
    }
    LOG.debug("String_Node_Str" + "String_Node_Str",getQuorumSize());
  }
  finally {
    sendTask.shutdown();
    ackProcessor.shutdown();
    preProcessor.shutdown();
    commitProcessor.shutdown();
    syncProcessor.shutdown();
    this.lastDeliveredZxid=commitProcessor.getLastDeliveredZxid();
    this.participantState.updateLastDeliveredZxid(this.lastDeliveredZxid);
  }
}