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

Konstantin Shvachko commented on HDFS-2452:
-------------------------------------------

I carried out a high-load test on a cluster running Hadoop 0.22. Because of the 
high load several DataNodes ran out of memory and died. The reason is that 
OutOfMemoryError occurred when DataXceiverServer.run() was starting a new 
DataXceiver, which is treated as a fatal error by current implementation.
{code}
2011-10-11 17:56:07,228 ERROR org.apache.hadoop.hdfs.server.datanode.DataNode: 
DatanodeRegistration( ... ):
DataXceiveServer: Exiting due to:java.lang.OutOfMemoryError: unable to create 
new native thread
        at java.lang.Thread.start0(Native Method)
        at java.lang.Thread.start(Thread.java:640)
        at 
org.apache.hadoop.hdfs.server.datanode.DataXceiverServer.run(DataXceiverServer.java:137)
        at java.lang.Thread.run(Thread.java:662)
{code}
In order to reproduce it one can write a unit test, which mocks 
{{DataXceiver.start()}} method to throw OutOfMemoryError.
I think DataXceiverServer should have a special catch statement for 
OutOfMemoryError, where it goes to a sleep for say 60 seconds and then go back 
to the main loop.
A word of caution here, as {{DataXceiver()}} constructor puts the socket into 
{{childSockets}}, and if the error happens in start() there will be nobody to 
remove it. It think it is better to move line 
{{dataXceiverServer.childSockets.put(s, s);}} from the {{DataXceiver()}} 
constructor into the {{DataXceiver.run()}} method.
                
> OutOfMemoryError in DataXceiverServer takes down the DataNode
> -------------------------------------------------------------
>
>                 Key: HDFS-2452
>                 URL: https://issues.apache.org/jira/browse/HDFS-2452
>             Project: Hadoop HDFS
>          Issue Type: Bug
>          Components: data-node
>    Affects Versions: 0.22.0
>            Reporter: Konstantin Shvachko
>             Fix For: 0.22.0
>
>
> OutOfMemoryError brings down DataNode, when DataXceiverServer tries to spawn 
> a new data transfer thread.

--
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