[ https://issues.apache.org/jira/browse/HIVE-23633?focusedWorklogId=444765&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-444765 ]
ASF GitHub Bot logged work on HIVE-23633: ----------------------------------------- Author: ASF GitHub Bot Created on: 12/Jun/20 08:36 Start Date: 12/Jun/20 08:36 Worklog Time Spent: 10m Work Description: kgyrtkirk commented on a change in pull request #1071: URL: https://github.com/apache/hive/pull/1071#discussion_r439284688 ########## File path: standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/ObjectStore.java ########## @@ -13317,6 +13325,10 @@ public int markScheduledExecutionsTimedOut(int timeoutSecs) throws InvalidOperat recoverInvalidScheduledQueryState(timeoutSecs); committed = commitTransaction(); return results.size(); + } catch (InvalidOperationException | MetaException e) { + throw e; + } catch (Exception e) { + throw new MetaException(e.getMessage()); Review comment: I don't know what kind of IDE you are using; but mine(eclipse) and maven is perfectly fine with this: ``` public static void main(String[] args) { try (aa x = new aa()) { System.out.println("body"); } finally { System.out.println("final"); } } static class aa implements AutoCloseable { public aa() { throw new RuntimeException(); } @Override public void close() { } } ``` note that `aa#close` doesn't throw `Exception` while `AutoCloseable#close` may. but anyway - let's go back to to the try-with-resources free version; the repackaging of the exceptions is one thing(which happens too much; and sometimes incorrectly around objectstore) - but now that try-with-resources is used the the "opentransaction" is also inside the try block - if the try fails the finally will still run; and may make the "counter" off by one... - the best would be to rewrite that as well to use try-with-resources but I'm aftraid that will be start a cascade of changes....it seems there is already some places which are using `openTransaction` in an interesting fashion... sorry for the detour; but its hard to make this part better.. ---------------------------------------------------------------- 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. For queries about this service, please contact Infrastructure at: us...@infra.apache.org Issue Time Tracking ------------------- Worklog Id: (was: 444765) Time Spent: 3h 50m (was: 3h 40m) > 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 > Priority: Major > Labels: pull-request-available > Time Spent: 3h 50m > 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)