mingyen066 commented on code in PR #23516:
URL: https://github.com/apache/kafka/pull/23516#discussion_r4064227562


##########
clients/src/main/java/org/apache/kafka/common/config/AbstractConfig.java:
##########
@@ -555,13 +555,16 @@ private Map<String, String> 
extractPotentialVariables(Map<?, ?> configMap) {
         Map<String, ConfigProvider> providers = 
instantiateConfigProviders(providerConfigString, configProperties, 
classNameFilter);
 
         if (!providers.isEmpty()) {
-            ConfigTransformer configTransformer = new 
ConfigTransformer(providers);
-            ConfigTransformerResult result = 
configTransformer.transform(indirectVariables);
-            if (!result.data().isEmpty()) {
-                resolvedOriginals.putAll(result.data());
+            try {

Review Comment:
   Could we add tests for the failure paths in AbstractConfigTest? For example:
   
   ```java
   @Test
   public void testConfigProvidersClosedWhenLaterProviderClassNotFound() {
       Properties props = new Properties();
       props.put("config.providers", "a,b");
       props.put("config.providers.a.class", 
MockFileConfigProvider.class.getName());
       String id = UUID.randomUUID().toString();
       props.put("config.providers.a.param.testId", id);
       props.put("config.providers.b.class", "org.example.DoesNotExist");
       assertThrows(ConfigException.class, () -> new 
TestIndirectConfigResolution(props));
       MockFileConfigProvider.assertClosed(id);
   }
   ```
   Two more cases with the same shape:
   - configure() throws
   - get() throws



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