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

Uma Maheswara Rao G commented on HDFS-2452:
-------------------------------------------

Hi Konstantin,
Thanks a lot for the review!

{quote}
Sleeping an arbitrary # of seconds is not a good solution, as it makes tests 
flaky, passing on some nodes and failing on other because of different 
environments. If you need to wait, then wait for a specific event (thread 
started in the case) rather than relying on passing time.
{quote}
We can set max time for test is 30secs (@Test(timeout=30000)). 
In testcase, I will close the sockets immediately when we get the 
OutOfMemoryError. Here i will use the CounDownLatch(1) in my stubbed Socket 
close method to latch.countDown(). So, main thread (test) will do 
latch.await(). After this i can assert for thread alive or not.
If you like this approach, i will go ahead with it.

{quote}
You are right, mocking getXceiverCount() doesn't work. May be Cos can help with 
that.
{quote}
Cos, do you have any other suggestion here?

Thanks
Uma

                
> 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
>            Assignee: Uma Maheswara Rao G
>             Fix For: 0.22.0
>
>         Attachments: HDFS-2452-22branch.1.patch, HDFS-2452-22branch.patch, 
> HDFS-2452-22branch.patch
>
>
> 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