Uploaded image for project: 'Kafka'
  1. Kafka
  2. KAFKA-9668

Iterating over KafkaStreams.getAllMetadata() results in ConcurrentModificationException

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 0.10.1.0
    • 2.5.0
    • streams
    • None

    Description

      `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`.

      Attachments

        Issue Links

          Activity

            People

              BigAndy Andy Coates
              BigAndy Andy Coates
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: