hachikuji commented on a change in pull request #11452: URL: https://github.com/apache/kafka/pull/11452#discussion_r754709824
########## File path: clients/src/main/java/org/apache/kafka/clients/producer/KafkaProducer.java ########## @@ -964,9 +964,10 @@ private void throwIfProducerClosed() { // producer callback will make sure to call both 'callback' and interceptor callback Callback interceptCallback = new InterceptorCallback<>(callback, this.interceptors, tp); - if (transactionManager != null && transactionManager.isTransactional()) { - transactionManager.failIfNotReadyForSend(); + if (transactionManager != null) { + transactionManager.maybeAddPartition(tp); Review comment: The way we did this before was a little strange. Logically, it makes more sense for the partition to be added to the transaction before we append the record to the accumulator. -- 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: jira-unsubscr...@kafka.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org