You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@kafka.apache.org by "Andy Coates (Jira)" <ji...@apache.org> on 2020/03/05 21:36:00 UTC

[jira] [Created] (KAFKA-9668) Iterating over KafkaStreams.getAllMetadata() results in ConcurrentModificationException

Andy Coates created KAFKA-9668:
----------------------------------

             Summary: Iterating over KafkaStreams.getAllMetadata() results in ConcurrentModificationException
                 Key: KAFKA-9668
                 URL: https://issues.apache.org/jira/browse/KAFKA-9668
             Project: Kafka
          Issue Type: Bug
          Components: streams
    Affects Versions: 0.10.1.0
            Reporter: Andy Coates
            Assignee: Andy Coates


`KafkaStreams.getAllMetadata()` returns `StreamsMetadataState.getAllMetadata()`. All the latter methods is `synchronized` it returns a reference to internal mutable state.  Not only does this break encapsulation, but it means any thread iterating over the returned collection when the metadata gets rebuilt will encounter a `ConcurrentModificationException`.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)