chia7712 commented on a change in pull request #8826:
URL: https://github.com/apache/kafka/pull/8826#discussion_r520293926



##########
File path: 
clients/src/main/java/org/apache/kafka/common/config/AbstractConfig.java
##########
@@ -105,7 +105,9 @@ public AbstractConfig(ConfigDef definition, Map<?, ?> 
originals,  Map<String, ?>
                 throw new ConfigException(entry.getKey().toString(), 
entry.getValue(), "Key must be a string.");
 
         this.originals = resolveConfigVariables(configProviderProps, 
(Map<String, Object>) originals);
-        this.values = definition.parse(this.originals);
+        // pass a copy to definition.parse. Otherwise, the definition.parse 
adds all keys of definitions to "used" group
+        // since definition.parse needs to call "RecordingMap#get" when 
checking all definitions.
+        this.values = definition.parse(new HashMap<>(this.originals));

Review comment:
       > I tried running console-producer with/without this PR. It doesn't seem 
to WARN any unused SSL configs in either test. Do you know why?
   
   @junrao this is the root cause.




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