You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hbase.apache.org by "Umesh Agashe (JIRA)" <ji...@apache.org> on 2016/10/21 22:56:58 UTC
[jira] [Work started] (HBASE-16930)
AssignmentManager.java:checkWals() function can recur infinitely
[ https://issues.apache.org/jira/browse/HBASE-16930?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Work on HBASE-16930 started by Umesh Agashe.
--------------------------------------------
> 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}
> 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)