You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by "Matthias J. Sax (JIRA)" <ji...@apache.org> on 2018/08/02 17:59:00 UTC

[jira] [Commented] (KAFKA-7233) InMemoryKeyValueStore is not thread-safe for Interactive Queries

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

Matthias J. Sax commented on KAFKA-7233:
----------------------------------------

Can you clarify? The implementation of the interface does use `synchronized` keyword: [https://github.com/apache/kafka/blob/trunk/streams/src/main/java/org/apache/kafka/streams/state/internals/InMemoryKeyValueStore.java#L100-L112]

It's only not declared on the interface – but this should not matter.

> InMemoryKeyValueStore is not thread-safe for Interactive Queries
> ----------------------------------------------------------------
>
>                 Key: KAFKA-7233
>                 URL: https://issues.apache.org/jira/browse/KAFKA-7233
>             Project: Kafka
>          Issue Type: Bug
>          Components: streams
>    Affects Versions: 1.1.0, 2.0.0
>         Environment: Fedora 27
>            Reporter: Hashan Gayasri Udugahapattuwa
>            Priority: Critical
>
> When querying externally from via the [ReadOnlyKeyValueStore|https://github.com/apache/kafka/blob/1.0/streams/src/main/java/org/apache/kafka/streams/state/ReadOnlyKeyValueStore.java] API (Interactive Queries), the InMemoryKeyValueStore does not protect its internal map from concurrent reads and writes which may produce incorrect results to the  ReadOnlyKeyValueStore API. Note that reads(query thread) and writes(stream thread) can happen concurrently.



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