From 34188b4cc4703f6919526ae10b7185842d1047b4 Mon Sep 17 00:00:00 2001 From: Apurva Mehta Date: Thu, 12 Oct 2017 16:53:27 -0700 Subject: [PATCH] MINOR: Bump the request timeout for the transactional message copier Multiple inflights means that when there are rolling bounces or other cluster instability, there is an increased likelihood of having previously tried batch expire in the accumulator. This is a fatal error for a transactional producer, causing the `TransactionalMessageCopier` to exit. To work around this, we bump the request timeout. We can get rid of this when KIP-91 is merged. Author: Apurva Mehta Reviewers: Jason Gustafson Closes #4039 from apurvam/MINOR-bump-request-timeout-in-transactional-message-copier --- .../org/apache/kafka/tools/TransactionalMessageCopier.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tools/src/main/java/org/apache/kafka/tools/TransactionalMessageCopier.java b/tools/src/main/java/org/apache/kafka/tools/TransactionalMessageCopier.java index 0d74645379e..87d27e8f259 100644 --- a/tools/src/main/java/org/apache/kafka/tools/TransactionalMessageCopier.java +++ b/tools/src/main/java/org/apache/kafka/tools/TransactionalMessageCopier.java @@ -155,6 +155,12 @@ public class TransactionalMessageCopier { props.put(ProducerConfig.BATCH_SIZE_CONFIG, "512"); props.put(ProducerConfig.MAX_IN_FLIGHT_REQUESTS_PER_CONNECTION, "5"); + // Multiple inflights means that when there are rolling bounces and other cluster instability, there is an + // increased likelihood of having previously tried batch expire in the accumulator. This is a fatal error + // for a transaction, causing the copier to exit. To work around this, we bump the request timeout. + // We can get rid of this when KIP-91 is merged. + props.put(ProducerConfig.REQUEST_TIMEOUT_MS_CONFIG, "60000"); + return new KafkaProducer<>(props); }