Description
If `initTransactions()` cannot be completed before the timeout defined by `max.block.ms`, then the call will raise a `TimeoutException`. The user is expected to retry this, which is what Kafka Streams does. However, the producer will keep retrying the `InitProducerId` request in the background and it is possible for it to return before the retry call to `initTransaction()`. This leads to the following exception:
org.apache.kafka.common.KafkaException: TransactionalId blah: Invalid transition attempted from state READY to state INITIALIZING at org.apache.kafka.clients.producer.internals.TransactionManager.transitionTo(TransactionManager.java:1077) at org.apache.kafka.clients.producer.internals.TransactionManager.transitionTo(TransactionManager.java:1070) at org.apache.kafka.clients.producer.internals.TransactionManager.lambda$initializeTransactions$1(TransactionManager.java:336) at org.apache.kafka.clients.producer.internals.TransactionManager.handleCachedTransactionRequestResult(TransactionManager.java:1198) at org.apache.kafka.clients.producer.internals.TransactionManager.initializeTransactions(TransactionManager.java:333) at org.apache.kafka.clients.producer.internals.TransactionManager.initializeTransactions(TransactionManager.java:328) at org.apache.kafka.clients.producer.KafkaProducer.initTransactions(KafkaProducer.java:597)
Attachments
Issue Links
- links to