Ashish K Singh created KAFKA-2466: ------------------------------------- Summary: ConsoleConsumer throws ConcurrentModificationException on termination Key: KAFKA-2466 URL: https://issues.apache.org/jira/browse/KAFKA-2466 Project: Kafka Issue Type: Bug Components: tools Reporter: Ashish K Singh Assignee: Ashish K Singh
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} -- This message was sent by Atlassian JIRA (v6.3.4#6332)