TaiJuWu commented on code in PR #17946: URL: https://github.com/apache/kafka/pull/17946#discussion_r1859537038
########## clients/src/main/java/org/apache/kafka/clients/producer/KafkaProducer.java: ########## @@ -1223,6 +1223,11 @@ private void ensureValidRecordSize(int size) { */ @Override public void flush() { + if (Thread.currentThread() == this.ioThread) { + log.error("flush invocation detected in the callback. This can cause a deadlock due to thread blocking."); Review Comment: I would like to know if this log is necessary? In my opinion, this information is already recorded bt `KafkaException`. -- 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