MINOR: only log first exception in RecordCollectorImpl producer callback
Author: Damian Guy
Reviewers: Guozhang Wang
Closes from dguy/producer-send-exception
@@ -96,10 +96,12 @@ public class RecordCollectorImpl implements RecordCollector {
TopicPartition tp = new TopicPartition(metadata.topic(), metadata.partition());
offsets.put(tp, metadata.offset());
} else {
+ 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);
}
}
+ }
});
return;
} catch (TimeoutException e) {
