chia7712 commented on code in PR #20159:
URL: https://github.com/apache/kafka/pull/20159#discussion_r2483850654
##########
clients/src/main/java/org/apache/kafka/clients/producer/KafkaProducer.java:
##########
@@ -248,6 +249,24 @@ public class KafkaProducer<K, V> implements Producer<K, V>
{
public static final String NETWORK_THREAD_PREFIX =
"kafka-producer-network-thread";
public static final String PRODUCER_METRIC_GROUP_NAME = "producer-metrics";
+ private static final String INIT_TXN_TIMEOUT_MSG =
+ "InitTransactions timed out – could not discover the transaction
coordinator or "
+ + "receive the InitProducerId response within max.block.ms (broker
unavailable, "
Review Comment:
ditto - could we avoid those specific root cause?
##########
clients/src/main/java/org/apache/kafka/clients/producer/KafkaProducer.java:
##########
@@ -248,6 +249,24 @@ public class KafkaProducer<K, V> implements Producer<K, V>
{
public static final String NETWORK_THREAD_PREFIX =
"kafka-producer-network-thread";
public static final String PRODUCER_METRIC_GROUP_NAME = "producer-metrics";
+ private static final String INIT_TXN_TIMEOUT_MSG =
+ "InitTransactions timed out – could not discover the transaction
coordinator or "
+ + "receive the InitProducerId response within max.block.ms (broker
unavailable, "
+ + "network lag, or ACL denial).";
+ private static final String SEND_OFFSETS_TIMEOUT_MSG =
+ "SendOffsetsToTransaction timed out – unable to reach the
consumer-group or "
+ + "transaction coordinator or to receive the
TxnOffsetCommit/AddOffsetsToTxn response "
+ + "within max.block.ms (coordinator unavailable, rebalance in
progress, network lag, or ACL denial).";
Review Comment:
ditto
##########
clients/src/main/java/org/apache/kafka/clients/producer/KafkaProducer.java:
##########
@@ -1237,7 +1263,7 @@ private ClusterAndWaitTime waitOnMetadata(String topic,
Integer partition, long
if (metadata.getError(topic) != null &&
metadata.getError(topic).exception() instanceof RetriableException) {
throw new TimeoutException(errorMessage,
metadata.getError(topic).exception());
}
- throw new TimeoutException(errorMessage);
+ throw new TimeoutException(errorMessage, new
KafkaException(METADATA_TIMEOUT_MSG));
Review Comment:
Should we use `metadata.getError(topic)` if it is not null?
--
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]