You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by GitBox <gi...@apache.org> on 2020/10/15 10:11:28 UTC

[GitHub] [kafka] dongjinleekr commented on a change in pull request #9414: KAFKA-10585: Kafka Streams should clean up the state store directory from cleanup

dongjinleekr commented on a change in pull request #9414:
URL: https://github.com/apache/kafka/pull/9414#discussion_r505424665



##########
File path: streams/src/main/java/org/apache/kafka/streams/processor/internals/StateDirectory.java
##########
@@ -301,6 +301,22 @@ public synchronized void clean() {
             );
             throw new StreamsException(exception);
         }
+
+        try {
+            if (hasPersistentStores && stateDir.exists() && !stateDir.delete()) {

Review comment:
       Exactly. But I thought keeping symmetry with the Consturctor is better.
   
   ```
   if (this.hasPersistentStores && !stateDir.exists() && !stateDir.mkdir()) {
       throw new ProcessorStateException(
           String.format("state directory [%s] doesn't exist and couldn't be created", stateDir.getPath()));
   }
   ```




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org