whhe commented on code in PR #3432:
URL: https://github.com/apache/flink-cdc/pull/3432#discussion_r1654752149
##########
flink-cdc-connect/flink-cdc-source-connectors/flink-connector-mysql-cdc/src/main/java/org/apache/flink/cdc/connectors/mysql/debezium/DebeziumUtils.java:
##########
@@ -324,11 +324,22 @@ private static long getBinlogTimestamp(BinaryLogClient
client, String binlogFile
client.setBinlogFilename(binlogFile);
client.setBinlogPosition(0);
- LOG.info("begin parse binlog: {}", binlogFile);
+ LOG.info("Begin parse binlog: {}", binlogFile);
client.connect();
} finally {
client.unregisterEventListener(eventListener);
}
+ if (binlogTimestamps.isEmpty()) {
+ try {
+ if (client.isConnected()) {
Review Comment:
IMO this condition should always be false.
##########
flink-cdc-connect/flink-cdc-source-connectors/flink-connector-mysql-cdc/src/main/java/org/apache/flink/cdc/connectors/mysql/debezium/DebeziumUtils.java:
##########
@@ -324,11 +324,22 @@ private static long getBinlogTimestamp(BinaryLogClient
client, String binlogFile
client.setBinlogFilename(binlogFile);
client.setBinlogPosition(0);
- LOG.info("begin parse binlog: {}", binlogFile);
+ LOG.info("Begin parse binlog: {}", binlogFile);
client.connect();
} finally {
client.unregisterEventListener(eventListener);
}
+ if (binlogTimestamps.isEmpty()) {
+ try {
+ if (client.isConnected()) {
+ client.disconnect();
+ }
+ } catch (IOException e) {
+ throw new RuntimeException(e);
+ }
+ LOG.warn("Failed to register eventListener and try to register it
again");
+ return getBinlogTimestamp(client, binlogFile);
Review Comment:
Regardless of the exception, I think there is no need to retry when the
queue is empty, the method should return and go to next binlog file.
--
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]