You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by "ASF GitHub Bot (JIRA)" <ji...@apache.org> on 2017/08/19 14:55:00 UTC
[jira] [Commented] (KAFKA-2105) NullPointerException in client on
MetadataRequest
[ https://issues.apache.org/jira/browse/KAFKA-2105?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16134129#comment-16134129 ]
ASF GitHub Bot commented on KAFKA-2105:
---------------------------------------
GitHub user omkreddy opened a pull request:
https://github.com/apache/kafka/pull/3697
KAFKA-2105: add topic null check to KafkaProducer.partitionsFor method
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/omkreddy/kafka KAFKA-2105
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/kafka/pull/3697.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #3697
----
commit 7a67d783571165cfc4fa5a301aeaaa3a139273af
Author: Manikumar Reddy <ma...@gmail.com>
Date: 2017-08-19T14:46:35Z
KAFKA-2105: add null check to KafkaProducer.partitionsFor method
----
> NullPointerException in client on MetadataRequest
> -------------------------------------------------
>
> Key: KAFKA-2105
> URL: https://issues.apache.org/jira/browse/KAFKA-2105
> Project: Kafka
> Issue Type: Bug
> Components: clients
> Affects Versions: 0.8.2.1
> Reporter: Roger Hoover
> Priority: Minor
> Attachments: guard-from-null.patch
>
>
> With the new producer, if you accidentally pass null to KafkaProducer.partitionsFor(null), it will cause the IO thread to throw NPE.
> Uncaught error in kafka producer I/O thread:
> java.lang.NullPointerException
> at org.apache.kafka.common.utils.Utils.utf8Length(Utils.java:174)
> at org.apache.kafka.common.protocol.types.Type$5.sizeOf(Type.java:176)
> at org.apache.kafka.common.protocol.types.ArrayOf.sizeOf(ArrayOf.java:55)
> at org.apache.kafka.common.protocol.types.Schema.sizeOf(Schema.java:81)
> at org.apache.kafka.common.protocol.types.Struct.sizeOf(Struct.java:218)
> at org.apache.kafka.common.requests.RequestSend.serialize(RequestSend.java:35)
> at org.apache.kafka.common.requests.RequestSend.<init>(RequestSend.java:29)
> at org.apache.kafka.clients.NetworkClient.metadataRequest(NetworkClient.java:369)
> at org.apache.kafka.clients.NetworkClient.maybeUpdateMetadata(NetworkClient.java:391)
> at org.apache.kafka.clients.NetworkClient.poll(NetworkClient.java:188)
> at org.apache.kafka.clients.producer.internals.Sender.run(Sender.java:191)
> at org.apache.kafka.clients.producer.internals.Sender.run(Sender.java:122)
> at java.lang.Thread.run(Thread.java:745)
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)