C0urante opened a new pull request #8608:
URL: https://github.com/apache/kafka/pull/8608


   [Jira](https://issues.apache.org/jira/browse/KAFKA-9950)
   
   MM2 is currently sharing the same `ConfigDef` object for all its connectors 
and tasks, which would be fine _if_ that object were used as-is. However, the 
`MirrorTaskConfig` class mutates the `ConfigDef` by defining additional 
properties, which leads to a potential `ConcurrentModificationException` during 
worker configuration validation and unintended inclusion of those new 
properties in the `ConfigDef` for the connectors which in turn is then visible 
via the REST API's `/connectors/{name}/config/validate` endpoint.
   
   The fix here is a one-liner that just creates a copy of the `ConfigDef` 
before defining new properties.
   
   A unit test is added that fails without this fix and passes with it.
   
   ### 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


Reply via email to