ruanhang1993 commented on code in PR #3388: URL: https://github.com/apache/flink-cdc/pull/3388#discussion_r1666165030
########## flink-cdc-connect/flink-cdc-source-connectors/flink-cdc-base/src/main/java/org/apache/flink/cdc/connectors/base/relational/connection/JdbcConnectionPools.java: ########## @@ -83,4 +84,12 @@ public String getJdbcUrl( } return jdbcConnectionPoolFactory.getJdbcUrl(sourceConfig); } + + public static void close() throws IOException { Review Comment: Should we use `synchronized` on this method? ########## flink-cdc-connect/flink-cdc-source-connectors/flink-connector-mysql-cdc/src/main/java/org/apache/flink/cdc/connectors/mysql/source/connection/JdbcConnectionPools.java: ########## @@ -51,4 +52,11 @@ public HikariDataSource getOrCreateConnectionPool( return pools.get(poolId); } } + + public static void close() throws IOException { + if (INSTANCE != null) { + INSTANCE.pools.values().stream().forEach(HikariDataSource::close); Review Comment: Should we add a object lock on the object `INSTANCE.pools`? -- 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: issues-unsubscr...@flink.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org