yuxiqian commented on code in PR #3221: URL: https://github.com/apache/flink-cdc/pull/3221#discussion_r1560712067
########## flink-cdc-connect/flink-cdc-source-connectors/flink-connector-mongodb-cdc/src/main/java/org/apache/flink/cdc/connectors/mongodb/source/reader/fetch/MongoDBStreamFetchTask.java: ########## @@ -108,7 +110,32 @@ public void execute(Context context) throws Exception { this.taskRunning = true; try { while (taskRunning) { - Optional<BsonDocument> next = Optional.ofNullable(changeStreamCursor.tryNext()); + Optional<BsonDocument> next = Optional.empty(); + try { + next = Optional.ofNullable(changeStreamCursor.tryNext()); + } catch (MongoQueryException e) { + if (e.getErrorCode() == CHANGE_STREAM_FATAL_ERROR) { + ChangeStreamOffset offset = + new ChangeStreamOffset(streamSplit.getStartingOffset().getOffset()); + if (offset.getTimestamp() != null) { + LOG.warn( + "Resume token {} has expired, fallback to timestamp startup mode.", Review Comment: Addressed that. -- 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