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 <apurva@confluent.io>

Reviewers: Jason Gustafson <jason@confluent.io>

Closes #4039 from apurvam/MINOR-bump-request-timeout-in-transactional-message-copier
This commit is contained in:
Apurva Mehta 2017-10-12 16:53:27 -07:00 committed by Jason Gustafson
parent 31fe1f98e2
commit 34188b4cc4
1 changed files with 6 additions and 0 deletions

View File

@ -155,6 +155,12 @@ public class TransactionalMessageCopier {
props.put(ProducerConfig.BATCH_SIZE_CONFIG, "512"); props.put(ProducerConfig.BATCH_SIZE_CONFIG, "512");
props.put(ProducerConfig.MAX_IN_FLIGHT_REQUESTS_PER_CONNECTION, "5"); 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); return new KafkaProducer<>(props);
} }