You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@kafka.apache.org by "Nishkam Ravi (Jira)" <ji...@apache.org> on 2019/10/03 04:16:00 UTC

[jira] [Created] (KAFKA-8970) StateDirectory creation fails with Exception

Nishkam Ravi created KAFKA-8970:
-----------------------------------

             Summary: StateDirectory creation fails with Exception
                 Key: KAFKA-8970
                 URL: https://issues.apache.org/jira/browse/KAFKA-8970
             Project: Kafka
          Issue Type: Bug
            Reporter: Nishkam Ravi


When two threads try to create KafkaStreams simultaneously, one of them succeeds while the other fails with the following exception:

org.apache.kafka.streams.errors.StreamsException: org.apache.kafka.streams.errors.ProcessorStateException: base state directory [/tmp/kafka-streams] doesn't exist and couldn't be created

Quick investigation suggests that this is because the code at/around:

[https://github.com/apache/kafka/blob/trunk/streams/src/main/java/org/apache/kafka/streams/processor/internals/StateDirectory.java#L82]

is not synchronized and can lead to race conditions.

Specifying different values for state.dir can be a workaround for this issue but a bit cumbersome. Can we just make this synchronized?



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