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

Sankar Hariappan commented on HIVE-16844:
-----------------------------------------

[~sbeeram]
Yes, you are right about running multiple instances of Metastore within same 
JVM. It is error prone. 
TestReplicationScenariosAcrossInstances worked fine by keeping the 
configurations same. But, it beats the purpose of having separate 
WarehouseInstances for primary and replica warehouses. With this fix, both 
primary and replica seems to share the same metastore dbs and also share common 
paths for replication dumps which is not great. Now, I'm trying to see if it is 
possible to instantiate metastore only once for the entire test suit.

Another approach would be to mock the ObjectStore class and keep only relevant 
methods used by our tests. We may override ObjectStore through the config 
hive.metastore.rawstore.impl. 

> Fix Connection leak in ObjectStore when new Conf object is used
> ---------------------------------------------------------------
>
>                 Key: HIVE-16844
>                 URL: https://issues.apache.org/jira/browse/HIVE-16844
>             Project: Hive
>          Issue Type: Bug
>          Components: Metastore
>            Reporter: Sunitha Beeram
>            Assignee: Sunitha Beeram
>             Fix For: 3.0.0
>
>         Attachments: HIVE-16844.1.patch
>
>
> The code path in ObjectStore.java currently leaks BoneCP (or Hikari) 
> connection pools when a new configuration object is passed in. The code needs 
> to ensure that the persistence-factory is closed before it is nullified.
> The relevant code is 
> [here|https://github.com/apache/hive/blob/master/metastore/src/java/org/apache/hadoop/hive/metastore/ObjectStore.java#L290].
>  Note that pmf is set to null, but the underlying connection pool is not 
> closed.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to