You are viewing a plain text version of this content. The canonical link for it is here.
Posted to hdfs-issues@hadoop.apache.org by "Colin Patrick McCabe (JIRA)" <ji...@apache.org> on 2014/10/27 18:53:35 UTC

[jira] [Comment Edited] (HDFS-7282) TestShortCircuitCache and TestBlockReaderFactory have failures caused by TemporarySocketDirectory getting garbage collected before Datanode starts up accessing the dir causing FileNotFoundException.

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

Colin Patrick McCabe edited comment on HDFS-7282 at 10/27/14 5:53 PM:
----------------------------------------------------------------------

bq. Not having the closes is not the root cause for the failures. The root cause is the TemporaryScoketDirectory are not being referenced anywhere in the test. Adding the close method is making sure TemporaryScoketDirectory is referenced during the test and it's consistent with some other test cases using TemporaryScoketDirectory .

[edit: it took me a minute or two to figure this out.  My first comment was wrong.]

OK, I see what's going on.  The object may get GC'ed immediately if it's not referenced later.  And then the finalizer removes the directory.  Ah.  Of course.

+1 for the patch.  I will re-trigger Jenkins since the last run had some issues it seems.


was (Author: cmccabe):
bq. Not having the closes is not the root cause for the failures. The root cause is the TemporaryScoketDirectory are not being referenced anywhere in the test. Adding the close method is making sure TemporaryScoketDirectory is referenced during the test and it's consistent with some other test cases using TemporaryScoketDirectory .

Are you saying that the JVM will "optimize out" the {{TemporarySocketDirectory}} object if the close is missing?  That seems like a JVM bug if true.  The constructor of that object runs {{File#mkdirs}}-- surely IBM JDK won't optimize out a constructor that has side effects?  Maybe I misunderstood this explanation?

In any case, I'm always +1 for closing things that need to be closed, so I am +1 for the patch.  I will re-trigger Jenkins since the last run had some issues it seems.

> TestShortCircuitCache and TestBlockReaderFactory have failures caused by TemporarySocketDirectory getting garbage collected before Datanode starts up accessing the dir causing FileNotFoundException.
> ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: HDFS-7282
>                 URL: https://issues.apache.org/jira/browse/HDFS-7282
>             Project: Hadoop HDFS
>          Issue Type: Bug
>          Components: test
>    Affects Versions: 2.4.1
>            Reporter: Jinghui Wang
>            Assignee: Jinghui Wang
>         Attachments: HDFS-7282.patch
>
>
> TemporarySocketDirectory has finalize method deletes the directory, in TestShortCircuitCache and TestBlockReaderFactory, the TemporarySocketDirectory created are not refereced later in the tests, which can get garbage collected (deleted the dir) before Datanode start up accessing the directory under TemporarySocketDirectory causing FileNotFoundException.



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