[
https://issues.apache.org/jira/browse/KAFKA-20922?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Matthias J. Sax updated KAFKA-20922:
------------------------------------
Issue Type: Improvement (was: Bug)
> TimestampedRangeWithHeadersQuery iterator can NPE on a null-deserialized
> value (KV path missing the null guard the window path has)
> -----------------------------------------------------------------------------------------------------------------------------------
>
> Key: KAFKA-20922
> URL: https://issues.apache.org/jira/browse/KAFKA-20922
> Project: Kafka
> Issue Type: Improvement
> Components: streams
> Affects Versions: 4.4.0
> Reporter: Jess Jin
> Priority: Minor
>
> MeteredTimestampedKeyValueStoreWithHeadersReadOnlyRecordIterator.next()
> (backing TimestampedRangeWithHeadersQuery) dereferences a possibly-null
> ValueTimestampHeaders:
> {code:java}
> final ValueTimestampHeaders<V> valueTimestampHeaders =
> valueTimestampHeadersDeserializer.apply(keyValue.value);
> final Headers headers = valueTimestampHeaders.headers(); // NPE if
> valueTimestampHeaders == null
> {code}
> ValueTimestampHeaders.make() returns null whenever the value deserializes to
> null, so valueTimestampHeaders can be null and .headers() throws a bare
> NullPointerException.
> The window-store path
> (MeteredWindowStoreWithHeadersReadOnlyRecordIterator.next()) already guards
> this and throws a StreamsException naming the key instead. The KV path should
> mirror that guard.
> Found during review of PR #22975:
> [https://github.com/apache/kafka/pull/22975#discussion_r3738681473]
--
This message was sent by Atlassian Jira
(v8.20.10#820010)