Avi Youkhananov created KAFKA-12841:
---------------------------------------
Summary: 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
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)