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

Kirk True commented on KAFKA-12841:
-----------------------------------

I have submitted a [pull request|https://github.com/apache/kafka/pull/10951] 
for review.

> NPE from the provided metadata in client callback in case of ApiException
> -------------------------------------------------------------------------
>
>                 Key: KAFKA-12841
>                 URL: https://issues.apache.org/jira/browse/KAFKA-12841
>             Project: Kafka
>          Issue Type: Bug
>          Components: clients
>    Affects Versions: 2.6.0
>         Environment: Prod
>            Reporter: Avi Youkhananov
>            Assignee: Kirk True
>            Priority: Major
>         Attachments: NPE.production
>
>
> 1.
> org.apache.kafka.clients.producer.Callback interface has method 
> onCompletion(...)
> Which says as part of the documentation :
> *The metadata for the record that was sent (i.e. the partition and offset). 
> *An empty metadata with -1 value for all fields* except for topicPartition 
> will be returned if an error occurred.
> We got an NPE from doSend(...) method in 
> org.apache.kafka.clients.producer.KafkaProducer 
> Which can occur in case ApiException was thrown ...
> In case of ApiException it uses the regular callback instead of 
> InterceptorCallback which also may cover the NPE.
> 2. More over RecordMetadata has method partition() which return int but can 
> also throw NPE because TopicPartition might be null.
> Stack trace attached.
>  



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

Reply via email to