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

BELUGA BEHR commented on HDFS-14258:
------------------------------------

[~elgoiri] I ReadWrite lock adds even more overhead and it's not really worth 
it here.  The methods you mentioned are mostly for testing (in fact, I'm not 
sure that {{getNumPeers()}} is even used anymore at all)  and only hold the 
lock a very short time. It's just not worth it.  I'm pretty sure we don't want 
multiple calls to {{sendOOBToPeers()}} happening at the same time; just one 
thread sending an OOB at a time.

In regards to a dead-lock, the {{noPeers}} {{Condition}} is associated with the 
{{lock}} object.  When waiting on that condition, the thread gives up the lock 
and only becomes active once the {{Condition}} has been signaled and has 
re-acquired the lock.

https://docs.oracle.com/javase/8/docs/api/java/util/concurrent/locks/Condition.html#awaitNanos-long-

Finally, for the unit test, I am a bit hesitant to want to add this test.  The 
code is not configurable (nor should we give users yet another nob to ignore), 
so it has to sleep for 30 seconds and that just adds even more time to the unit 
tests.  You tell me though and I'll be happy to add one; it is pretty simple to 
code up.

> Introduce Java Concurrent Package To DataXceiverServer Class
> ------------------------------------------------------------
>
>                 Key: HDFS-14258
>                 URL: https://issues.apache.org/jira/browse/HDFS-14258
>             Project: Hadoop HDFS
>          Issue Type: Improvement
>          Components: datanode
>    Affects Versions: 3.2.0
>            Reporter: BELUGA BEHR
>            Assignee: BELUGA BEHR
>            Priority: Minor
>         Attachments: HDFS-14258.1.patch, HDFS-14258.2.patch, 
> HDFS-14258.3.patch
>
>
> * Use Java concurrent package to replace current facilities in 
> {{DataXceiverServer}}.
> * A little bit of extra clean up



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: hdfs-issues-unsubscr...@hadoop.apache.org
For additional commands, e-mail: hdfs-issues-h...@hadoop.apache.org

Reply via email to