[
https://issues.apache.org/jira/browse/HIVE-25483?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17631199#comment-17631199
]
Ayush Saxena commented on HIVE-25483:
-------------------------------------
the fix type should be duplicate in that case and please link the Jira as well
> 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)