hadoop-common-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Anu Engineer (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (HADOOP-13388) Clean up TestLocalFileSystemPermission
Date Fri, 19 Aug 2016 16:30:20 GMT

    [ https://issues.apache.org/jira/browse/HADOOP-13388?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15428400#comment-15428400
] 

Anu Engineer commented on HADOOP-13388:
---------------------------------------

[~boky01] Thank you for taking care of all the issues. The new patch looks quite good. However
I am wondering if there is a small race condition in the cleanup path.

There are two functions where we have this same pattern. we do {{localfs.rename(dir2, copyPath);}}
and after  rename execute a bunch of statements. I am presuming that any of these statements
can fail, but little later at the end of the try block we do {{dir2=copyPath;}} based on this
assignment we invoke cleanup without checking if the file exists. 

if we get a failure in the bunch of lines between rename and assignment, I am worried that
cleanup will fail, that is dir2 will not be null, yet the file will not exist. In the earlier
code we checked if the file exists before calling cleanup which avoided this problem. You
can fix it by making sure that there are no statements that can fail between {{rename}} and
{{dir2=copyPath}} assignment or by bringing back the check for file  before invoking cleanup.

As I said at the start, the next function has a very similar code pattern.


> Clean up TestLocalFileSystemPermission
> --------------------------------------
>
>                 Key: HADOOP-13388
>                 URL: https://issues.apache.org/jira/browse/HADOOP-13388
>             Project: Hadoop Common
>          Issue Type: Bug
>          Components: fs
>            Reporter: Andras Bokor
>            Assignee: Andras Bokor
>            Priority: Trivial
>             Fix For: 3.0.0-alpha2
>
>         Attachments: HADOOP-13388.01.patch, HADOOP-13388.02.patch, HADOOP-13388.03.patch
>
>
> I see more problems with {{TestLocalFileSystemPermission}}:
> * Many checkstyle warnings
> * Relays on JUnit3 so Assume framework cannot be used for Windows checks.
> * In the tests in case of exception we get an error message but the test itself will
pass (because of the return).



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

---------------------------------------------------------------------
To unsubscribe, e-mail: common-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-issues-help@hadoop.apache.org


Mime
View raw message