Program: 80307
Project: 80307
Buggy source:
/** 
 * Wait for unregister message for all workers and then clean all znodes existing for this job.
 */
@Override public void postApplication(final MasterContext<MASTER_RESULT,WORKER_RESULT> context){
synchronized (LOCK) {
    this.currentInteration=context.getCurrentIteration();
  }
  new BasicCoordinatorCommand(){
    @Override public void doExecute() throws Exception, InterruptedException {
      try {
        String zkCleanUpEnabled=StringUtils.get(context.getProps().getProperty(GuaguaConstants.GUAGUA_ZK_CLEANUP_ENABLE),GuaguaConstants.GUAGUA_ZK_DEFAULT_CLEANUP_VALUE);
        final long start=System.nanoTime();
        if (Boolean.TRUE.toString().equalsIgnoreCase(zkCleanUpEnabled)) {
          new RetryCoordinatorCommand(isFixedTime(),getSleepTime()){
            @Override public boolean retryExecution() throws KeeperException, InterruptedException {
              int doneWorkers;
synchronized (LOCK) {
                doneWorkers=(int)NettyMasterCoordinator.this.iterResults.size();
              }
              if (TimeUnit.NANOSECONDS.toMillis(System.nanoTime() - start) > 120 * 1000L) {
                LOG.info("String_Node_Str",doneWorkers,(context.getWorkers() - doneWorkers));
                return true;
              }
              if (System.nanoTime() % 30 == 0) {
                LOG.info("String_Node_Str",doneWorkers,(context.getWorkers() - doneWorkers));
              }
              return isTerminated(doneWorkers,context.getWorkers(),GuaguaConstants.GUAGUA_DEFAULT_MIN_WORKERS_RATIO,GuaguaConstants.GUAGUA_DEFAULT_MIN_WORKERS_TIMEOUT);
            }
          }
.execute();
          String appNode=getAppNode(context.getAppId()).toString();
          try {
            getZooKeeper().deleteExt(appNode,-1,true);
          }
 catch (          KeeperException.NoNodeException e) {
            if (System.nanoTime() % 20 == 0) {
              LOG.warn("String_Node_Str",appNode);
            }
          }
        }
      }
  finally {
        if (NettyMasterCoordinator.this.messageServer != null) {
          Method shutDownMethod=ReflectionUtils.getMethod(NettyMasterCoordinator.this.messageServer.getClass(),"String_Node_Str");
          if (shutDownMethod != null) {
            shutDownMethod.invoke(NettyMasterCoordinator.this.messageServer,(Object[])null);
          }
          NettyMasterCoordinator.this.messageServer.releaseExternalResources();
        }
        NettyMasterCoordinator.super.closeZooKeeper();
        NettyMasterCoordinator.this.closeIterResults();
        NettyMasterCoordinator.this.iterResults.clear();
      }
    }
  }
.execute();
}

Fixed version (ground truth):
/** 
 * Wait for unregister message for all workers and then clean all znodes existing for this job.
 */
@Override public void postApplication(final MasterContext<MASTER_RESULT,WORKER_RESULT> context){
synchronized (LOCK) {
    this.currentInteration=context.getCurrentIteration();
  }
  new BasicCoordinatorCommand(){
    @Override public void doExecute() throws Exception, InterruptedException {
      try {
        String zkCleanUpEnabled=StringUtils.get(context.getProps().getProperty(GuaguaConstants.GUAGUA_ZK_CLEANUP_ENABLE),GuaguaConstants.GUAGUA_ZK_DEFAULT_CLEANUP_VALUE);
        final long start=System.nanoTime();
        if (Boolean.TRUE.toString().equalsIgnoreCase(zkCleanUpEnabled)) {
          new RetryCoordinatorCommand(isFixedTime(),getSleepTime()){
            @Override public boolean retryExecution() throws KeeperException, InterruptedException {
              int doneWorkers;
synchronized (LOCK) {
                doneWorkers=(int)NettyMasterCoordinator.this.iterResults.size();
              }
              if (TimeUnit.NANOSECONDS.toMillis(System.nanoTime() - start) > 120 * 1000L) {
                LOG.info("String_Node_Str" + "String_Node_Str",doneWorkers,(context.getWorkers() - doneWorkers));
                return true;
              }
              if (System.nanoTime() % 30 == 0) {
                LOG.info("String_Node_Str" + "String_Node_Str",doneWorkers,(context.getWorkers() - doneWorkers));
              }
              return isTerminated(doneWorkers,context.getWorkers(),GuaguaConstants.GUAGUA_DEFAULT_MIN_WORKERS_RATIO,GuaguaConstants.GUAGUA_DEFAULT_MIN_WORKERS_TIMEOUT);
            }
          }
.execute();
          String appNode=getAppNode(context.getAppId()).toString();
          try {
            getZooKeeper().deleteExt(appNode,-1,true);
          }
 catch (          KeeperException.NoNodeException e) {
            if (System.nanoTime() % 20 == 0) {
              LOG.warn("String_Node_Str",appNode);
            }
          }
        }
      }
  finally {
        if (NettyMasterCoordinator.this.messageServer != null) {
          Method shutDownMethod=ReflectionUtils.getMethod(NettyMasterCoordinator.this.messageServer.getClass(),"String_Node_Str");
          if (shutDownMethod != null) {
            shutDownMethod.invoke(NettyMasterCoordinator.this.messageServer,(Object[])null);
          }
          NettyMasterCoordinator.this.messageServer.releaseExternalResources();
        }
        NettyMasterCoordinator.super.closeZooKeeper();
        NettyMasterCoordinator.this.closeIterResults();
        NettyMasterCoordinator.this.iterResults.clear();
      }
    }
  }
.execute();
}