MartijnVisser commented on code in PR #235:
URL: 
https://github.com/apache/flink-connector-jdbc/pull/235#discussion_r4065673931


##########
flink-connector-jdbc-core/src/main/java/org/apache/flink/connector/jdbc/core/datastream/source/reader/JdbcSourceSplitReader.java:
##########
@@ -222,9 +222,9 @@ public void wakeUp() {}
     @Override
     public void close() throws Exception {
         closeResultSetAndStatement();
-        if (connection != null && !connection.isClosed()) {
-            connection.close();
-        }
+        // The provider is this reader's own copy, so closing it here also 
runs the teardown of a

Review Comment:
   Both of those leak, I checked. If the statement close throws the provider 
close never runs, and a provider that doesn't track the connection it hands out 
never closes it either. I went with `IOUtils.closeAll` rather than try/finally, 
since that also keeps the original exception when both fail.



-- 
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]

Reply via email to