hachikuji commented on a change in pull request #11448:
URL: https://github.com/apache/kafka/pull/11448#discussion_r744968165



##########
File path: core/src/main/scala/kafka/server/DynamicBrokerConfig.scala
##########
@@ -516,7 +516,15 @@ class DynamicBrokerConfig(private val kafkaConfig: 
KafkaConfig) extends Logging
     newProps ++= staticBrokerConfigs
     overrideProps(newProps, dynamicDefaultConfigs)
     overrideProps(newProps, dynamicBrokerConfigs)
-    val oldConfig = currentConfig
+
+    // We need a copy of the current config since `currentConfig` is 
initialized with `kafkaConfig`
+    // which means the call to `updateCurrentConfig` would end up mutating 
`oldConfig`.
+    val oldConfig = if (kafkaConfig eq currentConfig) {

Review comment:
       @rajinisivaram Hmm, good point. It looks like the bug only affects KRaft 
since there is no call to `initialize`. The code still feels a little slippery 
though, so maybe there is room for some defensiveness. Let me take a look.




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

To unsubscribe, e-mail: jira-unsubscr...@kafka.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to