kafka-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ewe...@apache.org
Subject kafka git commit: MINOR: avoid closing over both pre & post-transform record in WorkerSourceTask
Date Fri, 13 Jan 2017 01:09:36 GMT
Repository: kafka
Updated Branches:
  refs/heads/trunk b6011918f -> ad8ddf737


MINOR: avoid closing over both pre & post-transform record in WorkerSourceTask

Followup to #2299 for KAFKA-3209

Author: Shikhar Bhushan <shikhar@confluent.io>

Reviewers: Ewen Cheslack-Postava <ewen@confluent.io>

Closes #2365 from shikhar/2299-followup


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

Branch: refs/heads/trunk
Commit: ad8ddf737aea629b607693dbb2ee631937db698f
Parents: b601191
Author: Shikhar Bhushan <shikhar@confluent.io>
Authored: Thu Jan 12 17:09:30 2017 -0800
Committer: Ewen Cheslack-Postava <me@ewencp.org>
Committed: Thu Jan 12 17:09:30 2017 -0800

----------------------------------------------------------------------
 .../java/org/apache/kafka/connect/runtime/WorkerSourceTask.java | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/kafka/blob/ad8ddf73/connect/runtime/src/main/java/org/apache/kafka/connect/runtime/WorkerSourceTask.java
----------------------------------------------------------------------
diff --git a/connect/runtime/src/main/java/org/apache/kafka/connect/runtime/WorkerSourceTask.java
b/connect/runtime/src/main/java/org/apache/kafka/connect/runtime/WorkerSourceTask.java
index 092072d..adf1582 100644
--- a/connect/runtime/src/main/java/org/apache/kafka/connect/runtime/WorkerSourceTask.java
+++ b/connect/runtime/src/main/java/org/apache/kafka/connect/runtime/WorkerSourceTask.java
@@ -213,6 +213,7 @@ class WorkerSourceTask extends WorkerTask {
                 }
             }
             try {
+                final String topic = producerRecord.topic();
                 producer.send(
                         producerRecord,
                         new Callback() {
@@ -224,8 +225,8 @@ class WorkerSourceTask extends WorkerTask {
                                     // timeouts, callbacks with exceptions should never be
invoked in practice. If the
                                     // user overrode these settings, the best we can do is
notify them of the failure via
                                     // logging.
-                                    log.error("{} failed to send record to {}: {}", id, record.topic(),
e);
-                                    log.debug("Failed record: {}", record);
+                                    log.error("{} failed to send record to {}: {}", id, topic,
e);
+                                    log.debug("Failed record: {}", preTransformRecord);
                                 } else {
                                     log.trace("Wrote record successfully: topic {} partition
{} offset {}",
                                             recordMetadata.topic(), recordMetadata.partition(),


Mime
View raw message