You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-issues@hadoop.apache.org by "Tsz Wo Nicholas Sze (JIRA)" <ji...@apache.org> on 2019/02/20 00:00:00 UTC

[jira] [Commented] (HADOOP-16126) ipc.Client.stop() may sleep too long to wait for all connections

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

Tsz Wo Nicholas Sze commented on HADOOP-16126:
----------------------------------------------

Tried to change the sleep to wait-notify.  However, found some race conditions such as
- put a new connection could happen after stop.
- stop can be called twice.

Therefore, we will just change the sleep time here and then fix the race conditions and change to wait-notify in a separated JIRA.

> ipc.Client.stop() may sleep too long to wait for all connections
> ----------------------------------------------------------------
>
>                 Key: HADOOP-16126
>                 URL: https://issues.apache.org/jira/browse/HADOOP-16126
>             Project: Hadoop Common
>          Issue Type: Improvement
>          Components: ipc
>            Reporter: Tsz Wo Nicholas Sze
>            Assignee: Tsz Wo Nicholas Sze
>            Priority: Major
>
> {code}
> //Client.java
>   public void stop() {
>     ...
>     // wait until all connections are closed
>     while (!connections.isEmpty()) {
>       try {
>         Thread.sleep(100);
>       } catch (InterruptedException e) {
>       }
>     }
>     ...
>   }
> {code}
> In the code above, the sleep time is 100ms.  We found that simply changing the sleep time to 10ms could improve a Hive job running time by 10x.



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

---------------------------------------------------------------------
To unsubscribe, e-mail: common-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-issues-help@hadoop.apache.org