[
https://issues.apache.org/jira/browse/HBASE-16930?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Umesh Agashe updated HBASE-16930:
---------------------------------
Attachment: HBASE-16930.v1.patch
Fixes potential infinite recursion in AssignmentManager.checkWals().
> 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
> Attachments: HBASE-16930.v1.patch
>
>
> 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}
> dir is input arg and without changing it passed to call to checkWals() if
> child directory is found.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)