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

Removing headers causes ConcurrentModificationException

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 2.0.0
    • 2.4.2, 2.7.0, 2.5.2, 2.6.1
    • streams
    • None

    Description

      The consumer record that is used during punctuate is static, this can cause java.util.ConcurrentModificationException when modifying the headers. 

      Using a single instance of ConsumerRecord for all punctuates causes other strange behavior:

      1. Headers are shared across partitions.
      2. A topology that adds a single header could append an infinite number of headers (one per punctuate iteration), causing memory problems in the current topology as well as down stream consumers since the headers are written with the record when it is produced to a topic.  

       

      I would expect that each invocation of punctuate would be initialized with a new header object.

      Attachments

        Issue Links

          Activity

            People

              mramos Micah Ramos
              mramos Micah Ramos
              Votes:
              1 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: