kafka生产者i/o线程中的未捕获错误:java.util.concurrentmodificationexception:null

ix0qys7i  于 2021-06-04  发布在  Kafka
关注(0)|答案(1)|浏览(642)

我正在运行一个kafka流应用程序,最近我开始遇到以下异常,kafka流进程进入挂起关闭状态。这显示了kafka生产者内部api代码中的异常。会不会因为Kafka经纪人的重担?

2019-08-12 10:54:30 - [ERROR] [kafka-producer-network-thread | c8-max-view-live-1-StreamThread-1-producer] [org.apache.kafka.clients.producer.internals.Sender.run:235] : [Producer clientId=c8-max-view-live-1-StreamThread-1-producer] Uncaught error in kafka producer I/O thread:
java.util.ConcurrentModificationException: null
    at java.util.HashMap$HashIterator.nextNode(HashMap.java:1429)
    at java.util.HashMap$EntryIterator.next(HashMap.java:1463)
    at java.util.HashMap$EntryIterator.next(HashMap.java:1461)
    at org.apache.kafka.clients.producer.internals.Sender.getExpiredInflightBatches(Sender.java:177)
    at org.apache.kafka.clients.producer.internals.Sender.sendProducerData(Sender.java:353)
    at org.apache.kafka.clients.producer.internals.Sender.run(Sender.java:308)
    at org.apache.kafka.clients.producer.internals.Sender.run(Sender.java:233)
    at java.lang.Thread.run(Thread.java:745)
2019-08-12 10:54:30 - [ERROR] [kafka-producer-network-thread | c8-max-view-live-1-StreamThread-1-producer] [org.apache.kafka.clients.producer.internals.Sender.run:235] : [Producer clientId=c8-max-view-live-1-StreamThread-1-producer] Uncaught error in kafka producer I/O thread:
java.util.ConcurrentModificationException: null
    at java.util.HashMap$HashIterator.nextNode(HashMap.java:1429)
    at java.util.HashMap$EntryIterator.next(HashMap.java:1463)
    at java.util.HashMap$EntryIterator.next(HashMap.java:1461)
    at org.apache.kafka.clients.producer.internals.Sender.getExpiredInflightBatches(Sender.java:177)
    at org.apache.kafka.clients.producer.internals.Sender.sendProducerData(Sender.java:353)
    at org.apache.kafka.clients.producer.internals.Sender.run(Sender.java:308)
    at org.apache.kafka.clients.producer.internals.Sender.run(Sender.java:233)
    at java.lang.Thread.run(Thread.java:745)

在Kafka流进程挂起之后:

2019-08-12 10:54:31 - [INFO] [c8-max-view-live-1-StreamThread-1] [org.apache.kafka.streams.KafkaStreams.setState:257] : stream-client [c8-max-view-live-1] State transition from ERROR to PENDING_SHUTDOWN
2019-08-12 10:54:31 - [INFO] [kafka-streams-close-thread] [org.apache.kafka.streams.processor.internals.StreamThread.shutdown:1164] : stream-thread [c8-max-view-live-1-StreamThread-1] Informed to shut down
wfveoks0

wfveoks01#

发现并修复了一个错误,即在迭代时改变基础集合。请检查这里。

相关问题