scwhittle commented on code in PR #36685:
URL: https://github.com/apache/beam/pull/36685#discussion_r2480975621


##########
sdks/java/io/kafka/src/main/java/org/apache/beam/sdk/io/kafka/KafkaUnboundedReader.java:
##########
@@ -621,11 +624,18 @@ private void commitCheckpointMark() {
                     Collectors.toMap(
                         p -> new TopicPartition(p.getTopic(), 
p.getPartition()),
                         p -> new OffsetAndMetadata(p.getNextOffset()))));
+        nextAllowedCommitFailLogTime = now.plus(MIN_COMMIT_FAIL_LOG_INTERVAL);
       } catch (Exception e) {
         // Log but ignore the exception. Committing consumer offsets to Kafka 
is not critical for
         // KafkaIO because it relies on the offsets stored in 
KafkaCheckpointMark.
-        LOG.warn(
-            String.format("%s: Could not commit finalized checkpoint %s", 
this, checkpointMark), e);
+        if (now.isAfter(nextAllowedCommitFailLogTime)) {
+          LOG.warn(
+              String.format(
+                  "%s: Did not successfully commit finalized checkpoint for > 
%s: %s",
+                  this, MIN_COMMIT_FAIL_LOG_INTERVAL, checkpointMark),
+              e);
+          nextAllowedCommitFailLogTime = 
now.plus(MIN_COMMIT_FAIL_LOG_INTERVAL);
+        }

Review Comment:
   could log an info/debug log if not logging a warning?
   
   I think that the warning log is alarming to users but I think that if it was 
info and notes it will be attempted again after future reads, it might be nice 
to keep it as an info log for visiblity.



-- 
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]

Reply via email to