[ https://issues.apache.org/jira/browse/KAFKA-7218?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16563194#comment-16563194 ]
Kevin Lu edited comment on KAFKA-7218 at 7/31/18 6:42 AM: ---------------------------------------------------------- Hm... Does this require a KIP? This is a minor change, but it does affect KafkaConsumer exception log message... was (Author: lu.kevin): Hm... Does this require a KIP? > Log thread names & ids when KafkaConsumer throws > ConcurrentModificationException > -------------------------------------------------------------------------------- > > Key: KAFKA-7218 > URL: https://issues.apache.org/jira/browse/KAFKA-7218 > Project: Kafka > Issue Type: Improvement > Components: consumer, log > Reporter: Kevin Lu > Assignee: Kevin Lu > Priority: Minor > > KafkaConsumer does not support multi-threaded usage and any access by a > thread that does not have the lock will cause ConcurrentModificationException > to be thrown. > For some users leveraging frameworks on top of Kafka that abstract the actual > KafkaConsumer class/calls, it can be hard to identify user and/or framework > bugs when this exception is thrown. > It would be incredibly helpful to log both the thread name and the thread ID > of the thread that has acquired the lock, and the current thread that is > attempting to obtain the lock in the exception message. > > KafkaConsumer currently only tracks the id of the thread that has acquired > the lock. Additionally, we should also keep track of the thread name. > An example of the exception message: "KafkaConsumer is not safe for > multi-threaded access: acquiredThreadName=acquiredThread, acquiredThreadId=1, > currentThreadName=rejectedThread, currentThreadId=2" -- This message was sent by Atlassian JIRA (v7.6.3#76005)