You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by "Guozhang Wang (JIRA)" <ji...@apache.org> on 2018/05/10 00:09:00 UTC

[jira] [Resolved] (KAFKA-6878) NPE when querying global state store not in READY state

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

Guozhang Wang resolved KAFKA-6878.
----------------------------------
       Resolution: Fixed
    Fix Version/s: 1.1.1
                   2.0.0

> NPE when querying global state store not in READY state
> -------------------------------------------------------
>
>                 Key: KAFKA-6878
>                 URL: https://issues.apache.org/jira/browse/KAFKA-6878
>             Project: Kafka
>          Issue Type: Bug
>          Components: streams
>    Affects Versions: 1.1.0
>            Reporter: Salazar
>            Priority: Major
>             Fix For: 2.0.0, 1.1.1
>
>
> Info: using kafka 1.1.0 - confluent 4.1.0
> We're trying to query a global state store, but if we query too quickly after the application is started we get a NullPointerException(CachingKeyValueStore.java:166).
> We have verified the key is nonNull.
> If we wait long enough (with our current amount of data 5 minutes after start) we get an answer but before then we get NPEs.
>  
> Looks like there isn't a check to ensure `initInternal` actually sets the cache before you're allowed to use it in the get method
>  
> stacktrace:
> {code:java}
> java.lang.NullPointerException: null
> at org.apache.kafka.streams.state.internals.CachingKeyValueStore.getInternal(CachingKeyValueStore.java:166)
> at org.apache.kafka.streams.state.internals.CachingKeyValueStore.get(CachingKeyValueStore.java:159)
> at org.apache.kafka.streams.state.internals.CachingKeyValueStore.get(CachingKeyValueStore.java:38)
> at org.apache.kafka.streams.state.internals.InnerMeteredKeyValueStore.get(InnerMeteredKeyValueStore.java:183)
> at org.apache.kafka.streams.state.internals.MeteredKeyValueBytesStore.get(MeteredKeyValueBytesStore.java:112)
> at org.apache.kafka.streams.state.internals.CompositeReadOnlyKeyValueStore.get(CompositeReadOnlyKeyValueStore.java:55)
> at io.repository.VisitRepositoryKafka.findByVisitTrackingId(VisitRepositoryKafka.java:76)
> {code}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)