Program: 80289
Project: 80289
Buggy source:
/** 
 * Run guagua service according   {@link #isMaster} setting. Iteration, coordination will be included in servicerunning. <p> {@link #cleanup(org.apache.hadoop.mapreduce.Mapper.Context)} is called in finally block to make sure resourcescan be cleaned. <p> Guagua try best to update progress for each iteration. And also task status will be updated in each iteration in hadoop job web ui.
 */
@Override public void run(final Context context) throws IOException, InterruptedException {
  Exception e=null;
  try {
    this.setup(context);
    final int iterations=context.getConfiguration().getInt(GuaguaConstants.GUAGUA_ITERATION_COUNT,-1);
    this.getGuaguaService().run(new Progressable(){
      @Override public void progress(      int iteration,      int totalIteration,      String status,      boolean isLastUpdate,      boolean isKill){
        if (isKill) {
          failTask(null,context.getConfiguration());
          return;
        }
        context.progress();
        GuaguaMRRecordReader.setCurrentIteration(iteration);
        try {
          context.nextKeyValue();
        }
 catch (        IOException e) {
          throw new GuaguaRuntimeException(e);
        }
catch (        InterruptedException e) {
          Thread.currentThread().interrupt();
        }
        if (isLastUpdate) {
          LOG.info("String_Node_Str",(iteration * 100 / iterations));
        }
        if (status != null && status.length() != 0) {
          context.setStatus(status);
        }
      }
    }
);
  }
 catch (  Throwable t) {
    LOG.error("String_Node_Str",t);
    failTask(t,context.getConfiguration());
    e=new GuaguaRuntimeException(t);
  }
 finally {
    try {
      this.cleanup(context);
    }
 catch (    Throwable t) {
      failTask(t,context.getConfiguration());
      e=new GuaguaRuntimeException(t);
    }
  }
  if (e == null && !this.isMaster) {
    context.getCounter(GuaguaMapReduceConstants.GUAGUA_STATUS,GuaguaMapReduceConstants.DONE_WORKERS).increment(1L);
  }
  if (e == null && this.isMaster) {
    context.getCounter(GuaguaMapReduceConstants.GUAGUA_STATUS,GuaguaMapReduceConstants.MASTER_SUCCESS).increment(1);
    LOG.info("String_Node_Str");
    if (!isJobFinised(context.getConfiguration(),context.getConfiguration().getInt("String_Node_Str",20))) {
      Thread.sleep(3 * 1000L);
      this.killJob(context.getConfiguration());
    }
 else {
      LOG.info("String_Node_Str");
    }
  }
}

Fixed version (ground truth):
/** 
 * Run guagua service according   {@link #isMaster} setting. Iteration, coordination will be included in servicerunning. <p> {@link #cleanup(org.apache.hadoop.mapreduce.Mapper.Context)} is called in finally block to make sure resourcescan be cleaned. <p> Guagua try best to update progress for each iteration. And also task status will be updated in each iteration in hadoop job web ui.
 */
@Override public void run(final Context context) throws IOException, InterruptedException {
  Exception e=null;
  try {
    this.setup(context);
    final int iterations=context.getConfiguration().getInt(GuaguaConstants.GUAGUA_ITERATION_COUNT,-1);
    this.getGuaguaService().run(new Progressable(){
      @Override public void progress(      int iteration,      int totalIteration,      String status,      boolean isLastUpdate,      boolean isKill){
        if (isKill) {
          failTask(null,context.getConfiguration());
          return;
        }
        context.progress();
        GuaguaMRRecordReader.setCurrentIteration(iteration);
        try {
          context.nextKeyValue();
        }
 catch (        IOException e) {
          throw new GuaguaRuntimeException(e);
        }
catch (        InterruptedException e) {
          Thread.currentThread().interrupt();
        }
        if (isLastUpdate) {
          LOG.info("String_Node_Str",(iteration * 100 / iterations));
        }
        if (status != null && status.length() != 0) {
          context.setStatus(status);
        }
      }
    }
);
  }
 catch (  Throwable t) {
    LOG.error("String_Node_Str",t);
    failTask(t,context.getConfiguration());
    e=new GuaguaRuntimeException(t);
  }
 finally {
    try {
      this.cleanup(context);
    }
 catch (    Throwable t) {
      failTask(t,context.getConfiguration());
      e=new GuaguaRuntimeException(t);
    }
  }
  if (e == null && !this.isMaster) {
    context.getCounter(GuaguaMapReduceConstants.GUAGUA_STATUS,GuaguaMapReduceConstants.DONE_WORKERS).increment(1L);
  }
  if (e == null && this.isMaster) {
    context.getCounter(GuaguaMapReduceConstants.GUAGUA_STATUS,GuaguaMapReduceConstants.MASTER_SUCCESS).increment(1);
  }
}