johnjcasey commented on code in PR #36029:
URL: https://github.com/apache/beam/pull/36029#discussion_r2341925226
##########
sdks/java/io/kafka/src/main/java/org/apache/beam/sdk/io/kafka/ReadFromKafkaDoFn.java:
##########
@@ -588,23 +588,29 @@ public ProcessContinuation processElement(
topicPartition,
Optional.ofNullable(watermarkEstimator.currentWatermark()));
}
+ Duration remainingTimeout = this.consumerPollingTimeout;
long expectedOffset = tracker.currentRestriction().getFrom();
consumer.resume(Collections.singleton(topicPartition));
consumer.seek(topicPartition, expectedOffset);
final Stopwatch pollTimer = Stopwatch.createUnstarted();
final KafkaMetrics kafkaMetrics = KafkaSinkMetrics.kafkaMetrics();
try {
- while (true) {
+ while (Duration.ZERO.compareTo(remainingTimeout) < 0) {
Review Comment:
Should the total time be equal to the polling timeout? I would not think
these should necessesarily be the same number.
This could be inefficient with a small timeout
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]