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

## Proposed changes

Backport apache#41041.
  • Loading branch information
kaka11chen authored and zy-kkk committed Oct 8, 2024
1 parent b16c091 commit aca6142
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 aca6142

Please sign in to comment.