pierDipi commented on code in PR #13325:
URL: https://github.com/apache/kafka/pull/13325#discussion_r1149221534
##########
clients/src/main/java/org/apache/kafka/clients/consumer/KafkaConsumer.java:
##########
@@ -2547,9 +2547,10 @@ 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() + ") otherThread(id: " + currentThread.get() + ")");
Review Comment:
Sure
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]