hbase-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Umesh Agashe (JIRA)" <j...@apache.org>
Subject [jira] [Created] (HBASE-16930) AssignmentManager.java:checkWals() function can recur infinitely
Date Fri, 21 Oct 2016 22:50:58 GMT
Umesh Agashe created HBASE-16930:
------------------------------------

             Summary: AssignmentManager.java:checkWals() function can recur infinitely
                 Key: HBASE-16930
                 URL: https://issues.apache.org/jira/browse/HBASE-16930
             Project: HBase
          Issue Type: Bug
          Components: Region Assignment
            Reporter: Umesh Agashe
            Assignee: Umesh Agashe


Recursion in AssignmentManager.checkWals() uses the same input argument. See the code below:
{code}
  private boolean checkWals(FileSystem fs, Path dir) throws IOException {
    if (!fs.exists(dir)) {
      LOG.debug(dir + " doesn't exist");
      return false;
    }
    if (!fs.getFileStatus(dir).isDirectory()) {
      LOG.warn(dir + " is not a directory");
      return false;
    }
    FileStatus[] files = FSUtils.listStatus(fs, dir);
    if (files == null || files.length == 0) {
      LOG.debug(dir + " has no files");
      return false;
    }
    for (int i = 0; i < files.length; i++) {
      if (files[i].isFile() && files[i].getLen() > 0) {
        LOG.debug(dir + " has a non-empty file: " + files[i].getPath());
        return true;
      } else if (files[i].isDirectory() && checkWals(fs, dir)) {
        LOG.debug(dir + " is a directory and has a non-empty file: " + files[i].getPath());
        return true;
      }
    }
    LOG.debug("Found 0 non-empty wal files for :" + dir);
    return false;
  }
{code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message