pierDipi commented on code in PR #13325:
URL: https://github.com/apache/kafka/pull/13325#discussion_r1155728488


##########
clients/src/main/java/org/apache/kafka/clients/consumer/KafkaConsumer.java:
##########
@@ -2547,9 +2547,13 @@ private void acquireAndEnsureOpen() {
      * @throws ConcurrentModificationException if another thread already has 
the lock
      */
     private void acquire() {
-        long threadId = Thread.currentThread().getId();
+        final Thread thread = Thread.currentThread();
+        final long threadId = thread.getId();
         if (threadId != currentThread.get() && 
!currentThread.compareAndSet(NO_CURRENT_THREAD, threadId))
-            throw new ConcurrentModificationException("KafkaConsumer is not 
safe for multi-threaded access");
+            throw new ConcurrentModificationException("KafkaConsumer is not 
safe for multi-threaded access. " +
+                    "currentThread(name: " + thread.getName() + ", id: " + 
thread.getId() + ")" +

Review Comment:
   ```suggestion
                       "currentThread(name: " + thread.getName() + ", id: " + 
threadId + ")" +
   ```



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