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:18 GMT
Repository: kafka
Updated Branches:
  refs/heads/0.10.2 c96635291 -> 1e4cab761


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

(cherry picked from commit f615c9e9d2c59542665edd95cd7152f17e61f026)
Signed-off-by: Guozhang Wang <wangguoz@gmail.com>


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

Branch: refs/heads/0.10.2
Commit: 1e4cab7616c534a0c059126eb01131351fd0078d
Parents: c966352
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:05:13 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/1e4cab76/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 f243d82..1636578 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
@@ -97,8 +97,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