You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by "Kevin Lu (JIRA)" <ji...@apache.org> on 2018/07/31 06:42:00 UTC

[jira] [Commented] (KAFKA-7218) Log thread names & ids when KafkaConsumer throws ConcurrentModificationException

    [ https://issues.apache.org/jira/browse/KAFKA-7218?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16563194#comment-16563194 ] 

Kevin Lu commented on KAFKA-7218:
---------------------------------

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)