Issue Details (XML | Word | Printable)

Key: HADOOP-3121
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Minor Minor
Assignee: Tsz Wo (Nicholas), SZE
Reporter: Koji Noguchi
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Hadoop Common

dfs -lsr fail with "Could not get listing "

Created: 28/Mar/08 06:56 PM   Updated: 30/Jan/09 08:14 PM
Return to search
Component/s: fs
Affects Version/s: 0.16.1
Fix Version/s: 0.18.3

Time Tracking:
Not Specified

File Attachments:
  Size
Text File Licensed for inclusion in ASF works 3121_20081105.patch 2008-11-05 10:33 PM Tsz Wo (Nicholas), SZE 0.6 kB
Text File Licensed for inclusion in ASF works 3121_20081106.patch 2008-11-06 10:52 PM Tsz Wo (Nicholas), SZE 7 kB
Text File Licensed for inclusion in ASF works 3121_20081106b.patch 2008-11-06 11:14 PM Tsz Wo (Nicholas), SZE 7 kB
Text File Licensed for inclusion in ASF works 3121_20081107.patch 2008-11-07 06:24 PM Tsz Wo (Nicholas), SZE 8 kB
Text File Licensed for inclusion in ASF works 3121_20081107_0.18.patch 2008-11-07 09:46 PM Tsz Wo (Nicholas), SZE 8 kB
Text File Licensed for inclusion in ASF works HADOOP-3121.patch 2008-11-07 02:08 AM Raghu Angadi 7 kB

Hadoop Flags: Reviewed
Resolution Date: 07/Nov/08 10:09 PM


 Description  « Hide
(This happened a lot when namenode was extremely slow due to some other reasons.)

% hadoop dfs -lsr /

failed with

> Could not get listing for /aaa/bbb/randomfile

It's probably because file was deleted between items = fs.listStatus( and ls(items[i]

I think lsr should ignore this case and continue.



 All   Comments   Work Log   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
dhruba borthakur added a comment - 28/Mar/08 06:57 PM
This does not seem to be a regression and I propose that we fix it for 0.17.

T Meyarivan added a comment - 28/Oct/08 05:23 PM
Is it likely to be fixed in 0.18.x ?


Tsz Wo (Nicholas), SZE added a comment - 05/Nov/08 12:53 AM
This seems already fixed in trunk. At least, the behavior should be different since I could not find "Could not get listing " in the ls codes. I will check this in details.

Tsz Wo (Nicholas), SZE added a comment - 05/Nov/08 10:22 PM
> This seems already fixed in trunk...

Unfortunately, we still have this bug but the error message have been changed.

"lsr /", then remove /a right before lsr printing the result of /a

bash-3.2$ ./bin/hadoop fs -lsr /
drwxr-xr-x   - tsz supergroup          0 2008-11-05 14:01 /a
lsr: hdfs://namenode9000/a: No such file or directory.

I plan to change lsr such that lsr prints an error message and then keep listing other items.


Tsz Wo (Nicholas), SZE added a comment - 05/Nov/08 10:33 PM
3121_20081105.patch: print an error message and then keep listing other items, instead of throwing an exception and quit.
Same as before: "lsr /", then remove /a right before lsr printing the result of /a

bash-3.2$ ./bin/hadoop fs -lsr /
drwxr-xr-x   - tsz supergroup          0 2008-11-05 14:18 /a
hdfs://namenode:9000/a: No such file or directory.
drwxr-xr-x   - tsz supergroup          0 2008-11-05 14:18 /b
...

Raghu Angadi added a comment - 05/Nov/08 10:45 PM

Shouldn't it be the same for other exceptions? What if dir '/a' does not have permissions for this user?


Tsz Wo (Nicholas), SZE added a comment - 06/Nov/08 12:58 AM
> Shouldn't it be the same for other exceptions? What if dir '/a' does not have permissions for this user?

Since this issue is target for 0.18, I don't want to introduce big changes. How about we fix other exceptions in a separated issue?


Raghu Angadi added a comment - 06/Nov/08 06:31 PM - edited
Then I don't think it is a proper fix for the real issue. It fixes just one symptom reported.

> How about we fix other exceptions in a separated issue?
may be. +0 from me.


Tsz Wo (Nicholas), SZE added a comment - 06/Nov/08 10:52 PM
Raghu, I see your point now. Here is a new patch.

3121_20081106.patch: try-catch all IOException.


Raghu Angadi added a comment - 06/Nov/08 11:00 PM
Couple of comments:
  • do we need to rename ListStatus() to FileStatus()?
  • getFileStatus() name is too close to FS.getFileStatus(), might be confusing while reading the code.

I suggest renaming it to some thing like 'shellListStatus()'


Tsz Wo (Nicholas), SZE added a comment - 06/Nov/08 11:12 PM - edited
3121_20081106b.patch: renamed getFileStatus(...) to shellListStatus(...)

Raghu Angadi added a comment - 07/Nov/08 01:32 AM
Thanks Nicholas. looks good. One nit:

instead of ls throwing exception with "There were totally..." message, I think it is better to make ls return -1 and replace ls(..) with ' exitCode = ls() ' in doall().


Tsz Wo (Nicholas), SZE added a comment - 07/Nov/08 01:45 AM
> instead of ls throwing exception with "There were totally..." message, I think it is better to make ls return -1 and replace ls(..) with ' exitCode = ls() ' in doall().

I am not sure what do you mean. Could you post a patch for this?


Raghu Angadi added a comment - 07/Nov/08 02:08 AM
I hope attached patch clarifies what I mean. It behaves same as before and does not add extra line of output that is unecessary.

For e.g. compare 'bin/hadoop fs -ls /other' :

  • with the patch attached (and trunk) :
    ls: could not get get listing for '/other' : org.apache.hadoop.security.AccessControlException: Permission denied: [...]
    
  • with your patch :
    ls: could not get get listing for '/other' : org.apache.hadoop.security.AccessControlException: Permission denied: [...]
    ls: There were totaly 1 exception(s).
    

I don't think most command print extra lines like 'ls: There were totaly 1 exception(s)' at the end..'


Hadoop QA added a comment - 07/Nov/08 05:04 AM
+1 overall. Here are the results of testing the latest attachment
http://issues.apache.org/jira/secure/attachment/12393479/HADOOP-3121.patch
against trunk revision 712033.

+1 @author. The patch does not contain any @author tags.

+1 tests included. The patch appears to include 3 new or modified tests.

+1 javadoc. The javadoc tool did not generate any warning messages.

+1 javac. The applied patch does not increase the total number of javac compiler warnings.

+1 findbugs. The patch does not introduce any new Findbugs warnings.

+1 Eclipse classpath. The patch retains Eclipse classpath integrity.

+1 core tests. The patch passed core unit tests.

+1 contrib tests. The patch passed contrib unit tests.

Test results: http://hudson.zones.apache.org/hudson/job/Hadoop-Patch/3545/testReport/
Findbugs warnings: http://hudson.zones.apache.org/hudson/job/Hadoop-Patch/3545/artifact/trunk/build/test/findbugs/newPatchFindbugsWarnings.html
Checkstyle results: http://hudson.zones.apache.org/hudson/job/Hadoop-Patch/3545/artifact/trunk/build/test/checkstyle-errors.html
Console output: http://hudson.zones.apache.org/hudson/job/Hadoop-Patch/3545/console

This message is automatically generated.


Tsz Wo (Nicholas), SZE added a comment - 07/Nov/08 06:24 PM
> I don't think most command print extra lines like 'ls: There were totaly 1 exception(s)' at the end..'
I agree that the extra line is odd. Thanks.

3121_20081107.patch: We should also change FsShell.run(...) to update exitCode.


Raghu Angadi added a comment - 07/Nov/08 06:30 PM
+1 for your patch. thanks.

Tsz Wo (Nicholas), SZE added a comment - 07/Nov/08 06:52 PM
ant test-patch
     [exec] +1 overall.  

     [exec]     +1 @author.  The patch does not contain any @author tags.

     [exec]     +1 tests included.  The patch appears to include 3 new or modified tests.

     [exec]     +1 javadoc.  The javadoc tool did not generate any warning messages.

     [exec]     +1 javac.  The applied patch does not increase the total number of javac compiler warnings.

     [exec]     +1 findbugs.  The patch does not introduce any new Findbugs warnings.

     [exec]     +1 Eclipse classpath. The patch retains Eclipse classpath integrity.

Tsz Wo (Nicholas), SZE added a comment - 07/Nov/08 09:45 PM
The patch passed all unit tests locally.

Tsz Wo (Nicholas), SZE added a comment - 07/Nov/08 09:46 PM
3121_20081107_0.18.patch: for 0.18. It also passed all unit tests locally.

Tsz Wo (Nicholas), SZE added a comment - 07/Nov/08 10:09 PM
I just committed this.

Hudson added a comment - 08/Nov/08 04:47 PM
Integrated in Hadoop-trunk #655 (See http://hudson.zones.apache.org/hudson/job/Hadoop-trunk/655/)
. lsr should keep listing the remaining items but not terminate if there is any IOException. (szetszwo)