java.util.ConcurrentModificationException: KafkaConsumer is not safe for multi-threaded access

Apache's JIRA Issue Tracker | Ashish K Singh | 2 years ago
tip
Your exception is missing from the Samebug knowledge base.
Here are the best solutions we found on the Internet.
Click on the to mark the helpful solution and get rewards for you help.
  1. 0

    ConsoleConsumer throws ConcurrentModificationException on termination. ST: {code} Exception in thread "Thread-1" java.util.ConcurrentModificationException: KafkaConsumer is not safe for multi-threaded access at org.apache.kafka.clients.consumer.KafkaConsumer.acquire(KafkaConsumer.java:1169) at org.apache.kafka.clients.consumer.KafkaConsumer.close(KafkaConsumer.java:1087) at kafka.consumer.NewShinyConsumer.close(BaseConsumer.scala:50) at kafka.tools.ConsoleConsumer$$anon$1.run(ConsoleConsumer.scala:74) {code} Other thread which constantly tries to consume is {code} "main" prio=10 tid=0x00007f3aa800c000 nid=0x1314 runnable [0x00007f3aae37d000] java.lang.Thread.State: RUNNABLE at sun.nio.ch.EPollArrayWrapper.epollWait(Native Method) at sun.nio.ch.EPollArrayWrapper.poll(EPollArrayWrapper.java:269) at sun.nio.ch.EPollSelectorImpl.doSelect(EPollSelectorImpl.java:79) at sun.nio.ch.SelectorImpl.lockAndDoSelect(SelectorImpl.java:87) - locked <0x00000000dd1df130> (a sun.nio.ch.Util$2) - locked <0x00000000dd1df120> (a java.util.Collections$UnmodifiableSet) - locked <0x00000000dd0af720> (a sun.nio.ch.EPollSelectorImpl) at sun.nio.ch.SelectorImpl.select(SelectorImpl.java:98) at org.apache.kafka.common.network.Selector.select(Selector.java:440) at org.apache.kafka.common.network.Selector.poll(Selector.java:263) at org.apache.kafka.clients.NetworkClient.poll(NetworkClient.java:221) at org.apache.kafka.clients.consumer.internals.ConsumerNetworkClient.clientPoll(ConsumerNetworkClient.java:274) at org.apache.kafka.clients.consumer.internals.ConsumerNetworkClient.poll(ConsumerNetworkClient.java:182) at org.apache.kafka.clients.consumer.internals.ConsumerNetworkClient.poll(ConsumerNetworkClient.java:172) at org.apache.kafka.clients.consumer.KafkaConsumer.pollOnce(KafkaConsumer.java:779) at org.apache.kafka.clients.consumer.KafkaConsumer.poll(KafkaConsumer.java:730) at kafka.consumer.NewShinyConsumer.receive(BaseConsumer.scala:43) at kafka.tools.ConsoleConsumer$.process(ConsoleConsumer.scala:87) at kafka.tools.ConsoleConsumer$.run(ConsoleConsumer.scala:54) at kafka.tools.ConsoleConsumer$.main(ConsoleConsumer.scala:39) at kafka.tools.ConsoleConsumer.main(ConsoleConsumer.scala) {code}

    Apache's JIRA Issue Tracker | 2 years ago | Ashish K Singh
    java.util.ConcurrentModificationException: KafkaConsumer is not safe for multi-threaded access
  2. 0

    Intermittent failure of Kafka integration tests

    GitHub | 11 months ago | jamesnetherton
    java.util.ConcurrentModificationException: KafkaConsumer is not safe for multi-threaded access
  3. 0

    Clarification on Kafka Connect running in distributed mode - Production

    Google Groups | 7 months ago | Saravanan Tirugnanum
    java.util.ConcurrentModificationException: KafkaConsumer is not safe for multi-threaded access
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    Kafka Connect - Kafka Connect Mongodb Issues

    Google Groups | 2 months ago | Unknown author
    java.util.ConcurrentModificationException: KafkaConsumer is not safe for multi-threaded access

    1 unregistered visitors

    Root Cause Analysis

    1. java.util.ConcurrentModificationException

      KafkaConsumer is not safe for multi-threaded access

      at org.apache.kafka.clients.consumer.KafkaConsumer.acquire()
    2. Apache Kafka
      KafkaConsumer.close
      1. org.apache.kafka.clients.consumer.KafkaConsumer.acquire(KafkaConsumer.java:1169)
      2. org.apache.kafka.clients.consumer.KafkaConsumer.close(KafkaConsumer.java:1087)
      2 frames
    3. Apache Kafka
      ConsoleConsumer$$anon$1.run
      1. kafka.consumer.NewShinyConsumer.close(BaseConsumer.scala:50)
      2. kafka.tools.ConsoleConsumer$$anon$1.run(ConsoleConsumer.scala:74)
      2 frames