You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hive.apache.org by ku...@apache.org on 2019/10/22 08:58:22 UTC

[hive] branch master updated: HIVE-22375: ObjectStore.lockNotificationSequenceForUpdate is leaking query in case of error (Marta Kuczora reviewed by Peter Vary)

This is an automated email from the ASF dual-hosted git repository.

kuczoram pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/hive.git


The following commit(s) were added to refs/heads/master by this push:
     new f1e59e9  HIVE-22375: ObjectStore.lockNotificationSequenceForUpdate is leaking query in case of error (Marta Kuczora reviewed by Peter Vary)
f1e59e9 is described below

commit f1e59e9c905322db7062df6539edee73e5de25ca
Author: Marta Kuczora <ku...@cloudera.com>
AuthorDate: Tue Oct 22 10:57:35 2019 +0200

    HIVE-22375: ObjectStore.lockNotificationSequenceForUpdate is leaking query in case of error (Marta Kuczora reviewed by Peter Vary)
---
 .../java/org/apache/hadoop/hive/metastore/ObjectStore.java    | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/ObjectStore.java b/standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/ObjectStore.java
index 50e240e..e41c968 100644
--- a/standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/ObjectStore.java
+++ b/standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/ObjectStore.java
@@ -10001,10 +10001,13 @@ public class ObjectStore implements RawStore, Configurable {
       new RetryingExecutor(conf, () -> {
         prepareQuotes();
         Query query = pm.newQuery("javax.jdo.query.SQL", lockingQuery);
-        query.setUnique(true);
-        // only need to execute it to get db Lock
-        query.execute();
-        query.closeAll();
+        try {
+          query.setUnique(true);
+          // only need to execute it to get db Lock
+          query.execute();
+        } finally {
+          query.closeAll();
+        }
       }).run();
     }
   }