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`. (#41266)

## Proposed changes

Backport #41041.
  • Loading branch information
kaka11chen authored Sep 25, 2024
1 parent 869680b commit 306af52
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,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 @@ -111,8 +114,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 306af52

Please sign in to comment.