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

Iterating over KafkaStreams.getAllMetadata() results in ConcurrentModificationException

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 0.10.1.0
    • Fix Version/s: 2.5.0
    • Component/s: streams
    • Labels:
      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

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

                Dates

                • Created:
                  Updated:
                  Resolved: