[ https://issues.apache.org/jira/browse/HIVE-25483?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17629600#comment-17629600 ]
KIRTI RUGE edited comment on HIVE-25483 at 11/8/22 12:15 PM: ------------------------------------------------------------- This has been taken care already. TxnHandler.acquireLock() closes all DB connections . This has been fixed as a part of [*HIVE-24236: Fixed possible Connection leaks in TxnHandler (Yongzhi Chen, reviewed by Denys Kuzmenko)*|https://github.com/apache/hive/pull/1559/files#top] was (Author: JIRAUSER294595): This has been taken care already. TxnHandler.acquireLock() closes all DB connections . > TxnHandler::acquireLock should close the DB conn to avoid connection leaks > -------------------------------------------------------------------------- > > Key: HIVE-25483 > URL: https://issues.apache.org/jira/browse/HIVE-25483 > Project: Hive > Issue Type: Improvement > Reporter: Rajesh Balamohan > Assignee: KIRTI RUGE > Priority: Major > > TxnHandler::acquireLock should close DB connection on exiting the function. > [https://github.com/apache/hive/blob/master/standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/txn/TxnHandler.java#L5688] > [https://github.com/apache/hive/blob/master/standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/txn/TxnHandler.java#L5726] > [https://github.com/apache/hive/blob/master/standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/txn/TxnHandler.java#L5737-L5740] > If there are any exceptions downstream, this connection isn't closed > cleanly. In a corner case, hikari connection leak detector reported the > following > {noformat} > 2021-08-26 09:19:18,102 WARN com.zaxxer.hikari.pool.ProxyLeakTask: > [HikariPool-4 housekeeper]: Connection leak detection triggered for > org.postgresql.jdbc.PgConnection@77f76747, stack trace follows > java.lang.Exception: Apparent connection leak detected > at > org.apache.hadoop.hive.metastore.txn.TxnHandler.getDbConn(TxnHandler.java:3843) > at > org.apache.hadoop.hive.metastore.txn.TxnHandler.acquireLock(TxnHandler.java:5135) > > at > org.apache.hadoop.hive.ql.txn.compactor.Initiator.run(Initiator.java:107) > {noformat} -- This message was sent by Atlassian Jira (v8.20.10#820010)