kafka-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From guozh...@apache.org
Subject kafka git commit: MINOR: only log first exception in RecordCollectorImpl producer callback
Date Thu, 23 Mar 2017 17:05:05 GMT
Repository: kafka
Updated Branches:
  refs/heads/trunk 2269eed24 -> f615c9e9d


MINOR: only log first exception in RecordCollectorImpl producer callback

Author: Damian Guy <damian.guy@gmail.com>

Reviewers: Guozhang Wang <wangguoz@gmail.com>

Closes #2726 from dguy/producer-send-exception


Project: http://git-wip-us.apache.org/repos/asf/kafka/repo
Commit: http://git-wip-us.apache.org/repos/asf/kafka/commit/f615c9e9
Tree: http://git-wip-us.apache.org/repos/asf/kafka/tree/f615c9e9
Diff: http://git-wip-us.apache.org/repos/asf/kafka/diff/f615c9e9

Branch: refs/heads/trunk
Commit: f615c9e9d2c59542665edd95cd7152f17e61f026
Parents: 2269eed
Author: Damian Guy <damian.guy@gmail.com>
Authored: Thu Mar 23 10:04:58 2017 -0700
Committer: Guozhang Wang <wangguoz@gmail.com>
Committed: Thu Mar 23 10:04:58 2017 -0700

----------------------------------------------------------------------
 .../kafka/streams/processor/internals/RecordCollectorImpl.java | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/kafka/blob/f615c9e9/streams/src/main/java/org/apache/kafka/streams/processor/internals/RecordCollectorImpl.java
----------------------------------------------------------------------
diff --git a/streams/src/main/java/org/apache/kafka/streams/processor/internals/RecordCollectorImpl.java
b/streams/src/main/java/org/apache/kafka/streams/processor/internals/RecordCollectorImpl.java
index 685db54..c4a09de 100644
--- a/streams/src/main/java/org/apache/kafka/streams/processor/internals/RecordCollectorImpl.java
+++ b/streams/src/main/java/org/apache/kafka/streams/processor/internals/RecordCollectorImpl.java
@@ -96,8 +96,10 @@ public class RecordCollectorImpl implements RecordCollector {
                             TopicPartition tp = new TopicPartition(metadata.topic(), metadata.partition());
                             offsets.put(tp, metadata.offset());
                         } else {
-                            sendException = exception;
-                            log.error("{} Error sending record to topic {}. No more offsets
will be recorded for this task and the exception will eventually be thrown", logPrefix, topic,
exception);
+                            if (sendException == null) {
+                                sendException = exception;
+                                log.error("{} Error sending record to topic {}. No more offsets
will be recorded for this task and the exception will eventually be thrown", logPrefix, topic,
exception);
+                            }
                         }
                     }
                 });


Mime
View raw message