[ 
https://issues.apache.org/jira/browse/SPARK-27720?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16841325#comment-16841325
 ] 

Gabor Somogyi commented on SPARK-27720:
---------------------------------------

[~ov7a] Thanks for your efforts and I've had a look on the provided example + 
stacktrace.
Not sure why you've called start on the stream itself? (one should call start 
on StreamingContext only) Please have a look at the official DStream + Kafka 
example 
[here|https://github.com/apache/spark/blob/c6a45e6f67abc99d1953d915b96e65a3e2148cf1/examples/src/main/scala/org/apache/spark/examples/streaming/DirectKafkaWordCount.scala#L79].

> ConcurrentModificationException on operating with DirectKafkaInputDStream
> -------------------------------------------------------------------------
>
>                 Key: SPARK-27720
>                 URL: https://issues.apache.org/jira/browse/SPARK-27720
>             Project: Spark
>          Issue Type: Bug
>          Components: DStreams
>    Affects Versions: 2.4.1, 2.4.3
>            Reporter: ov7a
>            Priority: Minor
>
> If a DirectKafkaInputDStream is started in one thread and is being stopped in 
> another thread (e.g. by shutdown hook) a 
> java.util.ConcurrentModificationException (KafkaConsumer is not safe for 
> multi-threaded access) is thrown.
> This happens even if "spark.streaming.kafka.consumer.cache.enabled" is set to 
> "false".
> MWE: https://gist.github.com/ov7a/fc783315ea252a03d51804ce326a13b1
>  



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@spark.apache.org
For additional commands, e-mail: issues-h...@spark.apache.org

Reply via email to