[Fix](jdbc-scanner) Fix jdbc scanner memory leak because it didn't close outputTable. (#41266)
## Proposed changes Backport #41041.
This commit is contained in:
@ -99,6 +99,9 @@ public abstract class BaseJdbcExecutor implements JdbcExecutor {
|
||||
}
|
||||
|
||||
public void close() throws Exception {
|
||||
if (outputTable != null) {
|
||||
outputTable.close();
|
||||
}
|
||||
try {
|
||||
if (stmt != null && !stmt.isClosed()) {
|
||||
try {
|
||||
@ -111,8 +114,8 @@ public abstract class BaseJdbcExecutor implements JdbcExecutor {
|
||||
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());
|
||||
|
||||
Reference in New Issue
Block a user