You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@beam.apache.org by GitBox <gi...@apache.org> on 2022/09/01 17:59:44 UTC

[GitHub] [beam] Abacn commented on a diff in pull request #22962: Fix withCheckStopReadingFn to not cause the pipeline to crash

Abacn commented on code in PR #22962:
URL: https://github.com/apache/beam/pull/22962#discussion_r960957448


##########
sdks/java/io/kafka/src/main/java/org/apache/beam/sdk/io/kafka/ReadFromKafkaDoFn.java:
##########
@@ -343,6 +343,9 @@ public ProcessContinuation processElement(
     // Stop processing current TopicPartition when it's time to stop.
     if (checkStopReadingFn != null
         && checkStopReadingFn.apply(kafkaSourceDescriptor.getTopicPartition())) {
+      // Attempt to claim the last element in the restriction, such that the restriction tracker
+      // doesn't throw an exception when checkDone is called

Review Comment:
   Is this documented / designed behavior of restriction tracker (tracker is considered done when the last element has been claimed, not all elements are claimed)?
   Thinking about this because recently I was implementing something that turned out to rely on some internal behavior but then it broke as master evolves



-- 
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: github-unsubscribe@beam.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org