frankvicky commented on code in PR #17946:
URL: https://github.com/apache/kafka/pull/17946#discussion_r1860249120


##########
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 think it's ok to use both logging and exceptions simultaneously, as the 
user might want immediate hints displayed on the console.



-- 
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

Reply via email to