gaetancollaud opened a new pull request, #22588:
URL: https://github.com/apache/kafka/pull/22588

   # Summary
   
   Debezium (and maybe others) has a concept of deprecated fields. Those fields 
are returned by the `config()` method but are omitted from `validate()`.
   
   After the validation of a connector fail, AbstractHerder loops over the keys 
from `config()` but then tries to get the `configValue()` returned by 
`validate()` this creates a NPE.
   
   ## Other solution
   Instead of checking for null, another fix would be to not add the null 
ConfigValueInfo in the first place:
   ```java
   // line 980 of AbstractHerder.java
   ConfigValueInfo configValueInfo = null;
   if (configValueMap.containsKey(configName)) {
       ConfigValue configValue = configValueMap.get(configName);
       configValueInfo = convertConfigValue(configValue, type);
       errorCount += configValue.errorMessages().size();
   }
   configInfoList.add(new ConfigInfo(configKeyInfo, configValueInfo)); // move 
this inside the if above
   ```
   
   # Tests
   
   * I modified SampleSourceConnector to not return all the fields in 
`validate()`
   * I added `testDifferenceInConfigDefAndValidation` in AbstractHerderTest


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