Program: 61143
Project: 61143
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   {@link #taskReadyLock} ensures that it will try to grab every task thathas been put up
 * @throws InterruptedException
 */
@Override public void taskLoop() throws InterruptedException {
  while (!shouldStop) {
    int seq_start=taskReadySeq;
    List<String> paths=null;
    paths=getTaskList();
    if (paths == null) {
      LOG.warn("String_Node_Str" + watcher.splitLogZNode + "String_Node_Str");
      return;
    }
    int offset=(int)(Math.random() * paths.size());
    for (int i=0; i < paths.size(); i++) {
      if (DefaultWALProvider.isMetaFile(paths.get(i))) {
        offset=i;
        break;
      }
    }
    int numTasks=paths.size();
    for (int i=0; i < numTasks; i++) {
      int idx=(i + offset) % paths.size();
      if (this.calculateAvailableSplitters(numTasks) > 0) {
        grabTask(ZKUtil.joinZNode(watcher.splitLogZNode,paths.get(idx)));
      }
 else {
        LOG.debug("String_Node_Str" + server.getServerName() + "String_Node_Str"+ this.tasksInProgress.get()+ "String_Node_Str");
        break;
      }
      if (shouldStop) {
        return;
      }
    }
    SplitLogCounters.tot_wkr_task_grabing.incrementAndGet();
synchronized (taskReadyLock) {
      while (seq_start == taskReadySeq) {
        taskReadyLock.wait(checkInterval);
        if (server != null) {
          Map<String,Region> recoveringRegions=server.getRecoveringRegions();
          if (!recoveringRegions.isEmpty()) {
            List<String> tmpCopy=new ArrayList<String>(recoveringRegions.keySet());
            int listSize=tmpCopy.size();
            for (int i=0; i < listSize; i++) {
              String region=tmpCopy.get(i);
              String nodePath=ZKUtil.joinZNode(watcher.recoveringRegionsZNode,region);
              try {
                if (ZKUtil.checkExists(watcher,nodePath) == -1) {
                  server.getExecutorService().submit(new FinishRegionRecoveringHandler(server,region,nodePath));
                }
 else {
                  break;
                }
              }
 catch (              KeeperException e) {
                LOG.debug("String_Node_Str",e);
                break;
              }
            }
          }
        }
      }
    }
  }
}

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>taskReadyLock</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=null;
    paths=getTaskList();
    if (paths == null) {
      LOG.warn("String_Node_Str" + watcher.splitLogZNode + "String_Node_Str");
      return;
    }
    int offset=(int)(Math.random() * paths.size());
    for (int i=0; i < paths.size(); i++) {
      if (DefaultWALProvider.isMetaFile(paths.get(i))) {
        offset=i;
        break;
      }
    }
    int numTasks=paths.size();
    for (int i=0; i < numTasks; i++) {
      int idx=(i + offset) % paths.size();
      if (this.calculateAvailableSplitters(numTasks) > 0) {
        grabTask(ZKUtil.joinZNode(watcher.splitLogZNode,paths.get(idx)));
      }
 else {
        LOG.debug("String_Node_Str" + server.getServerName() + "String_Node_Str"+ this.tasksInProgress.get()+ "String_Node_Str");
        break;
      }
      if (shouldStop) {
        return;
      }
    }
    SplitLogCounters.tot_wkr_task_grabing.incrementAndGet();
synchronized (taskReadyLock) {
      while (seq_start == taskReadySeq.get()) {
        taskReadyLock.wait(checkInterval);
        if (server != null) {
          Map<String,Region> recoveringRegions=server.getRecoveringRegions();
          if (!recoveringRegions.isEmpty()) {
            List<String> tmpCopy=new ArrayList<String>(recoveringRegions.keySet());
            int listSize=tmpCopy.size();
            for (int i=0; i < listSize; i++) {
              String region=tmpCopy.get(i);
              String nodePath=ZKUtil.joinZNode(watcher.recoveringRegionsZNode,region);
              try {
                if (ZKUtil.checkExists(watcher,nodePath) == -1) {
                  server.getExecutorService().submit(new FinishRegionRecoveringHandler(server,region,nodePath));
                }
 else {
                  break;
                }
              }
 catch (              KeeperException e) {
                LOG.debug("String_Node_Str",e);
                break;
              }
            }
          }
        }
      }
    }
  }
}