Program: 60830
Project: 60830
Buggy source:
/** 
 * Wait for tasks to become available at /hbase/splitlog zknode. Grab a task one at a time. This policy puts an upper-limit on the number of simultaneous log splitting that could be happening in a cluster. <p> Synchronization using <code>taskReadySeq</code> ensures that it will try to grab every task that has been put up
 * @throws InterruptedException
 */
@Override public void taskLoop() throws InterruptedException {
  while (!shouldStop) {
    int seq_start=taskReadySeq.get();
    List<String> paths;
    paths=getTaskList();
    if (paths == null) {
      LOG.warn("String_Node_Str" + watcher.znodePaths.splitLogZNode + "String_Node_Str");
      return;
    }
    Collections.shuffle(paths);
    int offset=0;
    for (int i=0; i < paths.size(); i++) {
      if (AbstractFSWALProvider.isMetaFile(paths.get(i))) {
        offset=i;
        break;
      }
    }
    int numTasks=paths.size();
    int expectedTasksPerRS=getNumExpectedTasksPerRS(numTasks);
    boolean taskGrabbed=false;
    for (int i=0; i < numTasks; i++) {
      while (!shouldStop) {
        if (this.areSplittersAvailable(expectedTasksPerRS)) {
          LOG.debug("String_Node_Str" + server.getServerName() + "String_Node_Str");
          int idx=(i + offset) % paths.size();
          taskGrabbed|=grabTask(ZNodePaths.joinZNode(watcher.znodePaths.splitLogZNode,paths.get(idx)));
          break;
        }
 else {
          LOG.debug("String_Node_Str" + server.getServerName() + "String_Node_Str"+ this.tasksInProgress.get()+ "String_Node_Str");
          Thread.sleep(100);
        }
      }
      if (shouldStop) {
        return;
      }
    }
    if (!taskGrabbed && !shouldStop) {
      Thread.sleep(1000);
    }
    SplitLogCounters.tot_wkr_task_grabing.increment();
synchronized (taskReadySeq) {
      while (seq_start == taskReadySeq.get()) {
        taskReadySeq.wait(checkInterval);
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * Wait for tasks to become available at /hbase/splitlog zknode. Grab a task one at a time. This policy puts an upper-limit on the number of simultaneous log splitting that could be happening in a cluster. <p> Synchronization using <code>taskReadySeq</code> ensures that it will try to grab every task that has been put up
 * @throws InterruptedException
 */
@Override public void taskLoop() throws InterruptedException {
  while (!shouldStop) {
    int seq_start=taskReadySeq.get();
    List<String> paths;
    paths=getTaskList();
    if (paths == null) {
      LOG.warn("String_Node_Str" + watcher.getZNodePaths().splitLogZNode + "String_Node_Str");
      return;
    }
    Collections.shuffle(paths);
    int offset=0;
    for (int i=0; i < paths.size(); i++) {
      if (AbstractFSWALProvider.isMetaFile(paths.get(i))) {
        offset=i;
        break;
      }
    }
    int numTasks=paths.size();
    int expectedTasksPerRS=getNumExpectedTasksPerRS(numTasks);
    boolean taskGrabbed=false;
    for (int i=0; i < numTasks; i++) {
      while (!shouldStop) {
        if (this.areSplittersAvailable(expectedTasksPerRS)) {
          LOG.debug("String_Node_Str" + server.getServerName() + "String_Node_Str");
          int idx=(i + offset) % paths.size();
          taskGrabbed|=grabTask(ZNodePaths.joinZNode(watcher.getZNodePaths().splitLogZNode,paths.get(idx)));
          break;
        }
 else {
          LOG.debug("String_Node_Str" + server.getServerName() + "String_Node_Str"+ this.tasksInProgress.get()+ "String_Node_Str");
          Thread.sleep(100);
        }
      }
      if (shouldStop) {
        return;
      }
    }
    if (!taskGrabbed && !shouldStop) {
      Thread.sleep(1000);
    }
    SplitLogCounters.tot_wkr_task_grabing.increment();
synchronized (taskReadySeq) {
      while (seq_start == taskReadySeq.get()) {
        taskReadySeq.wait(checkInterval);
      }
    }
  }
}