jw-itq commented on code in PR #8754: URL: https://github.com/apache/seatunnel/pull/8754#discussion_r1990696558
########## 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: > Cursor expire will lost data (or read duplicate) or not? If we can make sure this behavior would not lost any data then not provode any option is ok. there is usually no data loss situation because the checkpoint saves the resume token and timestamp. If the timestamp is valid, there will be no problem, but if it is invalid, there will be an 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