[ 
https://issues.apache.org/jira/browse/KAFKA-9695?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17056464#comment-17056464
 ] 

ASF GitHub Bot commented on KAFKA-9695:
---------------------------------------

rajinisivaram commented on pull request #8266: KAFKA-9695; Handle null config 
values for createTopics, alterConfigs
URL: https://github.com/apache/kafka/pull/8266
 
 
   1) For createTopics, allow null values since we allow config instances to be 
created with null values in the map. This just uses default value.
   2) For incrementalAlterConfigs, don't allow null values since we have 
separate DELETE op for deleting configs. Throw InvalidRequestException if value 
is null for other ops.
   3) For the old alterConfigs API, AdminClient didn't allow null values. Throw 
InvalidRequestException similar to 2) if we do get a null value from a non-Java 
client.
   
   ### Committer Checklist (excluded from commit message)
   - [ ] Verify design and implementation 
   - [ ] Verify test coverage and CI build status
   - [ ] Verify documentation (including upgrade notes)
   
 
----------------------------------------------------------------
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:
[email protected]


> AdminClient allows null topic configs, but broker throws NPE
> ------------------------------------------------------------
>
>                 Key: KAFKA-9695
>                 URL: https://issues.apache.org/jira/browse/KAFKA-9695
>             Project: Kafka
>          Issue Type: Bug
>            Reporter: Rajini Sivaram
>            Assignee: Rajini Sivaram
>            Priority: Major
>             Fix For: 2.6.0
>
>
> Config entries may contain null values, but broker's AdminManager throws NPE 
> resulting in UnknownServerException. We should handle null values in configs.
> {code:java}
> [2020-03-10 21:56:07,904] ERROR [Admin Manager on Broker 0]: Error processing 
> create topic request CreatableTopic(name='topic', numPartitions=2, 
> replicationFactor=3, assignments=[], 
> configs=[CreateableTopicConfig(name='message.format.version', value=null), 
> CreateableTopicConfig(name='compression.type', value='producer')]) 
> (kafka.server.AdminManager:76)
> java.lang.NullPointerException
>       at java.util.Hashtable.put(Hashtable.java:460)
>       at java.util.Properties.setProperty(Properties.java:166)
>       at 
> kafka.server.AdminManager.$anonfun$createTopics$3(AdminManager.scala:99)
>       at scala.collection.Iterator.foreach(Iterator.scala:941)
>       at scala.collection.Iterator.foreach$(Iterator.scala:941)
>       at scala.collection.AbstractIterator.foreach(Iterator.scala:1429)
>       at scala.collection.IterableLike.foreach(IterableLike.scala:74)
>       at scala.collection.IterableLike.foreach$(IterableLike.scala:73)
>       at scala.collection.AbstractIterable.foreach(Iterable.scala:56)
>       at 
> kafka.server.AdminManager.$anonfun$createTopics$2(AdminManager.scala:98)
>       at 
> scala.collection.TraversableLike.$anonfun$map$1(TraversableLike.scala:238)
>       at 
> scala.collection.mutable.HashMap$$anon$2.$anonfun$foreach$3(HashMap.scala:158)
>       at scala.collection.mutable.HashTable.foreachEntry(HashTable.scala:237)
>       at scala.collection.mutable.HashTable.foreachEntry$(HashTable.scala:230)
>       at scala.collection.mutable.HashMap.foreachEntry(HashMap.scala:44)
>       at scala.collection.mutable.HashMap$$anon$2.foreach(HashMap.scala:158)
>       at scala.collection.TraversableLike.map(TraversableLike.scala:238)
>       at scala.collection.TraversableLike.map$(TraversableLike.scala:231)
>       at scala.collection.AbstractTraversable.map(Traversable.scala:108)
>       at kafka.server.AdminManager.createTopics(AdminManager.scala:91)
>       at 
> kafka.server.KafkaApis.handleCreateTopicsRequest(KafkaApis.scala:1701)
>       at kafka.server.KafkaApis.handle(KafkaApis.scala:147)
>       at kafka.server.KafkaRequestHandler.run(KafkaRequestHandler.scala:70)
>  {code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to