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

ASF GitHub Bot commented on KAFKA-9584:
---------------------------------------

MicahRam commented on pull request #8181: KAFKA-9584 Headers 
ConcurrentModificationException
URL: https://github.com/apache/kafka/pull/8181
 
 
   Prevent exceptions when modifying headers from punctuate by creating a new 
Headers before punctuate is performed. 
   
   Unit test added
   
   This contribution is my original work and that I license it to the project 
under the project's open source license.
   
   ### Committer Checklist (excluded from commit message)
   - [ ] Verify design and implementation 
   - [ ] Verify test coverage and CI build status
   - [ ] Verify documentation (including upgrade notes)
   
 
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Removing headers causes ConcurrentModificationException
> -------------------------------------------------------
>
>                 Key: KAFKA-9584
>                 URL: https://issues.apache.org/jira/browse/KAFKA-9584
>             Project: Kafka
>          Issue Type: Bug
>          Components: streams
>    Affects Versions: 2.0.0
>            Reporter: Micah Ramos
>            Priority: Minor
>
> 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:
>  # Headers are shared across partitions.
>  # 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.



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

Reply via email to