Skip to content

Commit

Permalink
[Fix](jdbc-scanner) Fix jdbc scanner memory leak.
Browse files Browse the repository at this point in the history
  • Loading branch information
kaka11chen committed Sep 20, 2024
1 parent 34ab55f commit 97dc45e
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,9 @@ public BaseJdbcExecutor(byte[] thriftParams) throws Exception {
}

public void close() throws Exception {
if (outputTable != null) {
outputTable.close();
}
try {
if (stmt != null && !stmt.isClosed()) {
try {
Expand All @@ -112,8 +115,8 @@ public void close() throws Exception {
if (conn != null && resultSet != null) {
abortReadConnection(conn, resultSet);
}
closeResources(resultSet, stmt, conn);
} finally {
closeResources(resultSet, stmt, conn);
if (config.getConnectionPoolMinSize() == 0 && hikariDataSource != null) {
hikariDataSource.close();
JdbcDataSource.getDataSource().getSourcesMap().remove(config.createCacheKey());
Expand Down

0 comments on commit 97dc45e

Please sign in to comment.