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

Nishkam Ravi commented on KAFKA-8970:
-------------------------------------

Hi [~guozhang] we're using 2.1.1 (so a bit behind master). We can try and see 
if we are able to update to a more recent version and reproduce this problem. 
Based on what I've seen in the code, we should be able to.

Full Stack trace:

```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 at 
org.apache.kafka.streams.KafkaStreams.<init>(KafkaStreams.java:649) at 
org.apache.kafka.streams.KafkaStreams.<init>(KafkaStreams.java:623) at 
org.apache.kafka.streams.KafkaStreams.<init>(KafkaStreams.java:607) at 
org.apache.kafka.streams.KafkaStreams.<init>(KafkaStreams.java:597)```

[~vvcephei] running different KStreams on the same machine works just fine (and 
is quite useful for us). As long as we initialize both from the same thread, 
there are no issues (this is what we've been doing for quite some time now). 

> StateDirectory creation fails with Exception
> --------------------------------------------
>
>                 Key: KAFKA-8970
>                 URL: https://issues.apache.org/jira/browse/KAFKA-8970
>             Project: Kafka
>          Issue Type: Bug
>          Components: streams
>            Reporter: Nishkam Ravi
>            Priority: Major
>
> 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)

Reply via email to