mumrah commented on code in PR #12455:
URL: https://github.com/apache/kafka/pull/12455#discussion_r933262928


##########
core/src/main/scala/kafka/server/KafkaConfig.scala:
##########
@@ -1493,6 +1493,7 @@ class KafkaConfig private(doLog: Boolean, val props: 
java.util.Map[_, _], dynami
 
   // Cache the current config to avoid acquiring read lock to access from 
dynamicConfig
   @volatile private var currentConfig = this
+  val processRoles: Set[ProcessRole] = parseProcessRoles()

Review Comment:
   On the line below, we are creating the DynamicBrokerConfig which gets a 
partially initialized KafkaConfig. In this PR, we're now reading the 
`processRoles` to determine which encoder to create. Since the KafkaConfig 
isn't fully initialized, this was null when DynamicBrokerConfig  was 
constructed.
   
   Moving `parseProcessRoles` up here seemed simpler than refactoring a bunch 
of this config code.



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