[ 
https://issues.apache.org/jira/browse/HIVE-23633?focusedWorklogId=645104&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-645104
 ]

ASF GitHub Bot logged work on HIVE-23633:
-----------------------------------------

                Author: ASF GitHub Bot
            Created on: 01/Sep/21 09:37
            Start Date: 01/Sep/21 09:37
    Worklog Time Spent: 10m 
      Work Description: pvary commented on a change in pull request #2344:
URL: https://github.com/apache/hive/pull/2344#discussion_r699837099



##########
File path: 
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/ObjectStore.java
##########
@@ -8142,9 +8146,11 @@ private void dropPartitionAllColumnGrantsNoTxn(
       query.declareParameters("java.lang.String t1");
       mSecurityDCList = (List<MDCPrivilege>) query.execute(dcName);
     }
+    try (Query q = query) {
     pm.retrieveAll(mSecurityDCList);

Review comment:
       NIT: formatting

##########
File path: 
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/ObjectStore.java
##########
@@ -8142,9 +8146,11 @@ private void dropPartitionAllColumnGrantsNoTxn(
       query.declareParameters("java.lang.String t1");
       mSecurityDCList = (List<MDCPrivilege>) query.execute(dcName);
     }
+    try (Query q = query) {

Review comment:
       We might have an error during execution. Should we close the query there 
too? 

##########
File path: 
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/MetaStoreDirectSql.java
##########
@@ -1454,12 +1455,14 @@ public ColumnStatistics getTableStats(final String 
catName, final String dbName,
       }
     };
     List<Object[]> list = Batchable.runBatched(batchSize, colNames, b);
+    final ColumnStatistics result;
     if (list.isEmpty()) {
-      return null;
+      result = null;
+    } else {
+      ColumnStatisticsDesc csd = new ColumnStatisticsDesc(true, dbName, 
tableName);
+      csd.setCatName(catName);
+      result = makeColumnStats(list, csd, 0, engine);
     }

Review comment:
       What happens if there is an exception? Should we close the query there 
too? 




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Issue Time Tracking
-------------------

    Worklog Id:     (was: 645104)
    Time Spent: 9h 10m  (was: 9h)

> Metastore some JDO query objects do not close properly
> ------------------------------------------------------
>
>                 Key: HIVE-23633
>                 URL: https://issues.apache.org/jira/browse/HIVE-23633
>             Project: Hive
>          Issue Type: Bug
>            Reporter: Zhihua Deng
>            Assignee: Zhihua Deng
>            Priority: Major
>              Labels: pull-request-available
>             Fix For: 4.0.0
>
>         Attachments: HIVE-23633.01.patch
>
>          Time Spent: 9h 10m
>  Remaining Estimate: 0h
>
> After patched [HIVE-10895|https://issues.apache.org/jira/browse/HIVE-10895],  
> The metastore still has seen a memory leak on db resources: many 
> StatementImpls left unclosed.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to