1996fanrui commented on code in PR #929:
URL:
https://github.com/apache/flink-kubernetes-operator/pull/929#discussion_r1929653819
##########
flink-autoscaler-plugin-jdbc/src/test/java/org/apache/flink/autoscaler/jdbc/testutils/databases/postgres/PostgreSQLExtension.java:
##########
@@ -66,7 +70,8 @@ public void afterAll(ExtensionContext extensionContext) {
@Override
public void afterEach(ExtensionContext extensionContext) throws Exception {
- try (var conn = getConnection();
+ try (var dataSource = getDataSource();
+ var conn = getDataSource().getConnection();
Review Comment:
```suggestion
var conn = dataSource.getConnection();
```
@sharath1709 I found a bug here, it should use data source instead of `
getDataSource()` here.
The second ` getDataSource()` is not closed. That's why connection is leaked.
https://github.com/apache/flink-kubernetes-operator/pull/929#issuecomment-2614195894
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]