Program: 130775
Project: 130775
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.
 */
void beginBroadcasting(ExecutorService es) throws TimeoutException, InterruptedException, IOException {
  int currentEpoch=getAckEpochFromFile();
  Zxid nextZxid=new Zxid(currentEpoch,0);
  PreProcessor preproc=new PreProcessor(this.stateMachine,nextZxid,this.quorumSet);
  AckProcessor ackProcessor=new AckProcessor(this.quorumSet,getQuorumSize());
  SyncProposalProcessor syncProcessor=new SyncProposalProcessor(this.log,this.transport);
  CommitProcessor commitProcessor=new CommitProcessor(this.log,this.stateMachine,this.config.getServerId());
  ShortCircuitTransport scTransport=new ShortCircuitTransport(syncProcessor,commitProcessor,this.messageQueue);
  PeerHandler lh=new PeerHandler(this.config.getServerId(),scTransport,this.config.getTimeout() / 3);
  lh.setFuture(es.submit(lh));
  this.quorumSet.put(this.config.getServerId(),lh);
  Zxid lastZxid=this.log.getLatestZxid();
  Message commit=MessageBuilder.buildCommit(lastZxid);
  queueAllPeers(commit);
  try {
    while (this.quorumSet.size() >= getQuorumSize()) {
      MessageTuple tuple=getMessage();
      Message msg=tuple.getMessage();
      String source=tuple.getSource();
      if (msg.getType() == MessageType.PROPOSED_EPOCH) {
        LOG.debug("String_Node_Str",this.config.getServerId(),source);
        Message newEpoch=MessageBuilder.buildNewEpochMessage(currentEpoch);
        sendMessage(source,newEpoch);
      }
 else       if (msg.getType() == MessageType.ACK_EPOCH) {
        LOG.debug("String_Node_Str",this.config.getServerId(),source);
        AckEpoch ackEpoch=msg.getAckEpoch();
        Zxid zxid=MessageBuilder.fromProtoZxid(ackEpoch.getLastZxid());
        PeerHandler ph=new PeerHandler(source,this.transport,this.config.getTimeout() / 3);
        ph.setLastZxid(zxid);
        ph.setNewLeaderEpoch(currentEpoch);
        ph.setSyncTask(new SyncPeerTask(source,zxid));
        this.quorumSet.put(source,ph);
        ph.setFuture(es.submit(ph));
      }
 else {
        if (!this.quorumSet.containsKey(source)) {
          LOG.debug("String_Node_Str",TextFormat.shortDebugString(msg),source);
          continue;
        }
        if (msg.getType() == MessageType.ACK) {
          LOG.debug("String_Node_Str",MessageBuilder.fromProtoZxid(msg.getAck().getZxid()),source);
          ackProcessor.processRequest(new Request(source,msg));
        }
 else         if (msg.getType() == MessageType.REQUEST) {
          LOG.debug("String_Node_Str",source);
          preproc.processRequest(new Request(this.config.getServerId(),msg));
        }
 else         if (msg.getType() == MessageType.HEARTBEAT) {
          LOG.trace("String_Node_Str",source);
        }
 else {
          LOG.warn("String_Node_Str",TextFormat.shortDebugString(msg),source);
        }
        this.quorumSet.get(source).updateHeartbeatTime();
        checkFollowerLiveness();
      }
    }
    LOG.debug("String_Node_Str" + "String_Node_Str",getQuorumSize());
  }
  finally {
    try {
      ackProcessor.shutdown();
      preproc.shutdown();
      commitProcessor.shutdown();
      syncProcessor.shutdown();
    }
 catch (    ExecutionException e) {
      LOG.error("String_Node_Str",e);
    }
  }
}

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.
 */
void beginBroadcasting(ExecutorService es) throws TimeoutException, InterruptedException, IOException {
  int currentEpoch=getAckEpochFromFile();
  Zxid nextZxid=new Zxid(currentEpoch,0);
  PreProcessor preproc=new PreProcessor(this.stateMachine,nextZxid,this.quorumSet);
  AckProcessor ackProcessor=new AckProcessor(this.quorumSet,getQuorumSize());
  SyncProposalProcessor syncProcessor=new SyncProposalProcessor(this.log,this.transport);
  CommitProcessor commitProcessor=new CommitProcessor(this.log,this.stateMachine,this.config.getServerId());
  ShortCircuitTransport scTransport=new ShortCircuitTransport(syncProcessor,commitProcessor,this.messageQueue);
  PeerHandler lh=new PeerHandler(this.config.getServerId(),scTransport,this.config.getTimeout() / 3);
  lh.setLastAckedZxid(this.log.getLatestZxid());
  lh.setFuture(es.submit(lh));
  this.quorumSet.put(this.config.getServerId(),lh);
  Zxid lastZxid=this.log.getLatestZxid();
  Message commit=MessageBuilder.buildCommit(lastZxid);
  queueAllPeers(commit);
  try {
    while (this.quorumSet.size() >= getQuorumSize()) {
      MessageTuple tuple=getMessage();
      Message msg=tuple.getMessage();
      String source=tuple.getSource();
      if (msg.getType() == MessageType.PROPOSED_EPOCH) {
        LOG.debug("String_Node_Str",this.config.getServerId(),source);
        Message newEpoch=MessageBuilder.buildNewEpochMessage(currentEpoch);
        sendMessage(source,newEpoch);
      }
 else       if (msg.getType() == MessageType.ACK_EPOCH) {
        LOG.debug("String_Node_Str",this.config.getServerId(),source);
        AckEpoch ackEpoch=msg.getAckEpoch();
        Zxid zxid=MessageBuilder.fromProtoZxid(ackEpoch.getLastZxid());
        PeerHandler ph=new PeerHandler(source,this.transport,this.config.getTimeout() / 3);
        ph.setLastZxid(zxid);
        ph.setNewLeaderEpoch(currentEpoch);
        ph.setSyncTask(new SyncPeerTask(source,zxid));
        this.quorumSet.put(source,ph);
        ph.setFuture(es.submit(ph));
      }
 else {
        if (!this.quorumSet.containsKey(source)) {
          LOG.debug("String_Node_Str",TextFormat.shortDebugString(msg),source);
          continue;
        }
        if (msg.getType() == MessageType.ACK) {
          LOG.debug("String_Node_Str",MessageBuilder.fromProtoZxid(msg.getAck().getZxid()),source);
          ackProcessor.processRequest(new Request(source,msg));
        }
 else         if (msg.getType() == MessageType.REQUEST) {
          LOG.debug("String_Node_Str",source);
          preproc.processRequest(new Request(this.config.getServerId(),msg));
        }
 else         if (msg.getType() == MessageType.HEARTBEAT) {
          LOG.trace("String_Node_Str",source);
        }
 else {
          LOG.warn("String_Node_Str",TextFormat.shortDebugString(msg),source);
        }
        this.quorumSet.get(source).updateHeartbeatTime();
        checkFollowerLiveness();
      }
    }
    LOG.debug("String_Node_Str" + "String_Node_Str",getQuorumSize());
  }
  finally {
    try {
      ackProcessor.shutdown();
      preproc.shutdown();
      commitProcessor.shutdown();
      syncProcessor.shutdown();
    }
 catch (    ExecutionException e) {
      LOG.error("String_Node_Str",e);
    }
  }
}