divijvaidya commented on code in PR #12228:
URL: https://github.com/apache/kafka/pull/12228#discussion_r952810999


##########
core/src/main/java/kafka/server/builders/ReplicaManagerBuilder.java:
##########
@@ -147,11 +147,14 @@ public ReplicaManagerBuilder setThreadNamePrefix(String 
threadNamePrefix) {
 
     public ReplicaManager build() {
         if (config == null) config = new KafkaConfig(Collections.emptyMap());
-        if (metrics == null) metrics = new Metrics();
         if (logManager == null) throw new RuntimeException("You must set 
logManager");
         if (metadataCache == null) throw new RuntimeException("You must set 
metadataCache");
         if (logDirFailureChannel == null) throw new RuntimeException("You must 
set logDirFailureChannel");
         if (alterPartitionManager == null) throw new RuntimeException("You 
must set alterIsrManager");
+        // Initialize metrics in the end just before passing it to 
ReplicaManager because ReplicaManager closes the

Review Comment:
   Fixed in upcoming commit



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to