gharris1727 commented on code in PR #15078:
URL: https://github.com/apache/kafka/pull/15078#discussion_r1437200184
##########
clients/src/main/java/org/apache/kafka/clients/admin/internals/FenceProducersHandler.java:
##########
@@ -82,9 +86,10 @@ InitProducerIdRequest.Builder buildSingleRequest(int
brokerId, CoordinatorKey ke
.setProducerEpoch(ProducerIdAndEpoch.NONE.epoch)
.setProducerId(ProducerIdAndEpoch.NONE.producerId)
.setTransactionalId(key.idValue)
- // Set transaction timeout to 1 since it's only being initialized
to fence out older producers with the same transactional ID,
- // and shouldn't be used for any actual record writes
- .setTransactionTimeoutMs(1);
+ // Set transaction timeout to the equivalent as the fenceProducers
request since it's only being initialized to fence out older producers with the
same transactional ID,
+ // and shouldn't be used for any actual record writes. This has
been changed to match the fenceProducers request timeout from one as some
brokers may be slower than expected
+ // and we need a safe timeout that allows the transaction init to
finish.
+ .setTransactionTimeoutMs(this.options.timeoutMs());
Review Comment:
The timeoutMs is nullable, and is always null when using the default
FenceProducersOptions.
When it is null we should use the KafkaAdminClient#defaultApiTimeoutMs,
similar to deleteRecords or calcDeadlineMs.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]