Hisoka-X commented on code in PR #8754: URL: https://github.com/apache/seatunnel/pull/8754#discussion_r1990515556
########## seatunnel-connectors-v2/connector-cdc/connector-cdc-mongodb/src/main/java/org/apache/seatunnel/connectors/seatunnel/cdc/mongodb/source/fetch/MongodbStreamFetchTask.java: ########## @@ -117,7 +120,23 @@ public void execute(Context context) { this.taskRunning = true; try { while (taskRunning) { - Optional<BsonDocument> next = Optional.ofNullable(changeStreamCursor.tryNext()); + Optional<BsonDocument> next; + try { + next = Optional.ofNullable(changeStreamCursor.tryNext()); + } catch (MongoCommandException e) { + if (MongodbUtils.checkIfChangeStreamCursorExpires(e)) { Review Comment: Can we add an option to let user decide to fallback to timestamp restart mode or direct throw exception? -- 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: commits-unsubscr...@seatunnel.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org