You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by GitBox <gi...@apache.org> on 2021/11/08 18:00:57 UTC
[GitHub] [kafka] hachikuji commented on a change in pull request #11448: KAFKA-13417; Ensure dynamic reconfigurations set old config properly
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-unsubscribe@kafka.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org