Skip to content

Commit

Permalink
[Fix](jdbc-scanner) Fix jdbc scanner memory leak because it didn't cl…
Browse files Browse the repository at this point in the history
…ose `outputTable`. (#41041)

## Proposed changes

[Fix] (jdbc-scanner) Fix jdbc scanner memory leak because it didn't
close `outputTable`.
  • Loading branch information
kaka11chen authored Sep 21, 2024
1 parent d348d83 commit 6bceb32
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 6bceb32

Please sign in to comment.