stevenzwu commented on code in PR #9308: URL: https://github.com/apache/iceberg/pull/9308#discussion_r1428500261
########## flink/v1.18/flink/src/main/java/org/apache/iceberg/flink/source/reader/IcebergSourceSplitReader.java: ########## @@ -80,6 +87,18 @@ public RecordsWithSplitIds<RecordAndPosition<T>> fetch() throws IOException { } if (currentReader.hasNext()) { + // Wait until the reader is blocked. Wake every second in case this missed a signal + while (pausedSplits.contains(currentSplitId)) { Review Comment: I am not sure this implements the contract correctly. ``` /** * Fetch elements into the blocking queue for the given splits. The fetch call could be blocking * but it should get unblocked when {@link #wakeUp()} is invoked. In that case, the * implementation may either decide to return without throwing an exception, or it can just * throw an interrupted exception. In either case, this method should be reentrant, meaning that * the next fetch call should just resume from where the last fetch call was waken up or * interrupted. It is up to the implementer to either read all the records of the split or to * stop reading them at some point (for example when a given threshold is exceeded). In that * later case, when fetch is called again, the reading should restart at the record where it * left off based on the {@code SplitState}. * * @return the Ids of the finished splits. * @throws IOException when encountered IO errors, such as deserialization failures. */ RecordsWithSplitIds<E> fetch() throws IOException; ``` -- 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...@iceberg.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org For additional commands, e-mail: issues-h...@iceberg.apache.org