You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by "Jason Gustafson (Jira)" <ji...@apache.org> on 2021/09/14 16:49:00 UTC

[jira] [Resolved] (KAFKA-13149) Null Pointer Exception for record==null when handling a produce request

     [ https://issues.apache.org/jira/browse/KAFKA-13149?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jason Gustafson resolved KAFKA-13149.
-------------------------------------
    Fix Version/s: 3.0.1
       Resolution: Fixed

> Null Pointer Exception for record==null when handling a produce request
> -----------------------------------------------------------------------
>
>                 Key: KAFKA-13149
>                 URL: https://issues.apache.org/jira/browse/KAFKA-13149
>             Project: Kafka
>          Issue Type: Bug
>          Components: log
>            Reporter: Cong Ding
>            Priority: Major
>             Fix For: 3.0.1
>
>
> In production, we have seen an exception
> {code:java}
> java.lang.NullPointerException: Cannot invoke "org.apache.kafka.common.record.Record.hasMagic(byte)" because "record" is null{code}
> which is triggered by
>  [https://github.com/apache/kafka/blob/bfc57aa4ddcd719fc4a646c2ac09d4979c076455/core/src/main/scala/kafka/log/LogValidator.scala#L191]
>  when handling a produce request.
> The reason is that [https://github.com/apache/kafka/blob/bfc57aa4ddcd719fc4a646c2ac09d4979c076455/clients/src/main/java/org/apache/kafka/common/record/DefaultRecord.java#L294-L296] returns record==null, which is possibly caused by a bad client. However, we have no idea about the client in our multi-tenant environment.
> We should let the broker throw an invalid record exception and notify clients.



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