hailin0 commented on code in PR #4327:
URL:
https://github.com/apache/incubator-seatunnel/pull/4327#discussion_r1134832909
##########
seatunnel-connectors-v2/connector-cdc/connector-cdc-mysql/src/main/java/org/apache/seatunnel/connectors/seatunnel/cdc/mysql/source/reader/fetch/MySqlSourceFetchTaskContext.java:
##########
@@ -159,6 +163,18 @@ public void configure(SourceSplitBase sourceSplitBase) {
this.errorHandler = new
MySqlErrorHandler(connectorConfig.getLogicalName(), queue);
}
+ @Override
+ public void close() {
+ try {
+ this.connection.close();
+ this.binaryLogClient.disconnect();
+ } catch (SQLException e) {
+ log.warn("Failed to close connection, {}",
ExceptionUtils.getMessage(e));
+ } catch (IOException e) {
+ log.warn("Failed to close binaryLogClient, {}",
ExceptionUtils.getMessage(e));
Review Comment:
```suggestion
log.warn("Failed to close connection", e);
} catch (IOException e) {
log.warn("Failed to close binaryLogClient", e);
```
##########
seatunnel-connectors-v2/connector-cdc/connector-cdc-sqlserver/src/main/java/org/apache/seatunnel/connectors/seatunnel/cdc/sqlserver/source/source/reader/fetch/SqlServerSourceFetchTaskContext.java:
##########
@@ -158,6 +162,16 @@ public void configure(SourceSplitBase sourceSplitBase) {
this.errorHandler = new
SqlServerErrorHandler(connectorConfig.getLogicalName(), queue);
}
+ @Override
+ public void close() {
+ try {
+ this.dataConnection.close();
+ this.metadataConnection.close();
+ } catch (SQLException e) {
+ log.warn("Failed to close connection, {}",
ExceptionUtils.getMessage(e));
Review Comment:
```suggestion
log.warn("Failed to close connection", e);
```
--
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]