[ 
https://issues.apache.org/jira/browse/HIVE-16593?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Rui Li updated HIVE-16593:
--------------------------
    Attachment: HIVE-16593.1.patch

I think stop and createClient shouldn't share the same lock. In 
{{RpcServer.close}} we cancel pending clients, which means we should be allowed 
to run {{RpcServer.registerClient}} and {{RpcServer.close}} concurrently.
The stopLock in the patch is only added in case we call stop from multiple 
threads and thus avoiding NPE.

> SparkClientFactory.stop may prevent JVM from exiting
> ----------------------------------------------------
>
>                 Key: HIVE-16593
>                 URL: https://issues.apache.org/jira/browse/HIVE-16593
>             Project: Hive
>          Issue Type: Bug
>          Components: Spark
>            Reporter: Rui Li
>            Assignee: Rui Li
>         Attachments: HIVE-16593.1.patch
>
>
> When we receive SIGINT more than once, we call System.exit to terminate the 
> JVM. System.exit runs the shutdown hooks which in turn calls 
> SparkClientFactory.stop. All the methods in SparkClientFactory are 
> synchronized and at this point, we may be waiting to create a SparkClientImpl 
> in SparkClientFactory.createClient. Therefore SparkClientFactory.stop will be 
> blocked until SparkClientFactory.createClient returns.
> The reason why we may be waiting to create SparkClientImpl is usually to wait 
> for RemoteDriver to connect. If RemoteDriver runs into problem, the JVM won't 
> exit until we timeout.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Reply via email to