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

Denys Kuzmenko commented on HIVE-20737:
---------------------------------------

public void open(HiveConf conf) throws HiveException {
   closeLock.readLock().lock();
   try {
       hiveSparkClient = HiveSparkClientFactory.createHiveSparkClient(conf, 
sessionId,
        ....

}

Double-checked locking should be used, otherwise it might happen than inner 
logic of the "open" method will be attempted multiple times. In 
LocalHiveSparkClient, "new SparkContext()" will throw exception "Only one 
SparkContext may be running in this JVM".

 

> LocalHiveSparkClient and SparkSession race condition fix
> --------------------------------------------------------
>
>                 Key: HIVE-20737
>                 URL: https://issues.apache.org/jira/browse/HIVE-20737
>             Project: Hive
>          Issue Type: Bug
>          Components: Hive
>            Reporter: Denys Kuzmenko
>            Priority: Major
>         Attachments: HIVE-20737.1.patch
>
>




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

Reply via email to