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

Tsz Wo (Nicholas), SZE commented on HADOOP-8325:
------------------------------------------------

After changed to TreeSet, hasShutdownHook and removeShutdownHook does not work 
unless the priority is also passed.  The failure of TestFileContextDeleteOnExit 
is related to this.  The problem is that HookEntry.equals(..) and 
HookEntry.compareTo(..) are not consistent, i.e. HookEntry.compareTo(that) == 0 
does not imply HookEntry.equals == true.  Two possible solutions:
- check priority in equals and pass priority in hasShutdownHook and 
removeShutdownHook.
- use HashSet and remove compareTo(..) from HookEntry.  Use comparator in 
sorting.  The comparator passed should sort reverse order.  Since it is a 
separated comparator, I think it won't be counter intuitive.
                
> Add a ShutdownHookManager to be used by different components instead of the 
> JVM shutdownhook
> --------------------------------------------------------------------------------------------
>
>                 Key: HADOOP-8325
>                 URL: https://issues.apache.org/jira/browse/HADOOP-8325
>             Project: Hadoop Common
>          Issue Type: Bug
>          Components: fs
>    Affects Versions: 2.0.0
>            Reporter: Alejandro Abdelnur
>            Assignee: Alejandro Abdelnur
>            Priority: Critical
>             Fix For: 2.0.0
>
>         Attachments: HADOOP-8325.patch, HADOOP-8325.patch, HADOOP-8325.patch, 
> HADOOP-8325.patch, HADOOP-8325.patch
>
>
> FileSystem adds a JVM shutdown hook when a filesystem instance is cached.
> MRAppMaster also uses a JVM shutdown hook, among other things, the 
> MRAppMaster JVM shutdown hook is used to ensure state are written to HDFS.
> This creates a race condition because each JVM shutdown hook is a separate 
> thread and if there are multiple JVM shutdown hooks there is not assurance of 
> order of execution, they could even run in parallel.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to