Uploaded image for project: 'Kafka'
  1. Kafka
  2. KAFKA-6655

CleanupThread: Failed to lock the state directory due to an unexpected exception (Windows OS)

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 1.0.1
    • None
    • streams
    • None
    • Windows Operating System

    Description

      This issue happens on Windows OS. It code works fine on Linux. This ticket is related to KAFKA-6647, that also reports locking issues on Windows. However, there, the issue occurs if users calls KafkaStreams#cleanUp() explicitly, while this ticket is related to KafkaStreams background CleanupThread (note, that both use `StateDirectory.cleanRemovedTasks`, but behavior is still slightly different as different parameters are passed into the method).

      [CleanupThread] Failed to lock the state directory due to an unexpected exceptionjava.nio.file.DirectoryNotEmptyException: \tmp\kafka-streams\srini-20171208\0_9
      at sun.nio.fs.WindowsFileSystemProvider.implDelete(WindowsFileSystemProvider.java:266)
      at sun.nio.fs.AbstractFileSystemProvider.delete(AbstractFileSystemProvider.java:103)
      at java.nio.file.Files.delete(Files.java:1126)
      at org.apache.kafka.common.utils.Utils$1.postVisitDirectory(Utils.java:636)
      at org.apache.kafka.common.utils.Utils$1.postVisitDirectory(Utils.java:619)
      at java.nio.file.Files.walkFileTree(Files.java:2688)
      at java.nio.file.Files.walkFileTree(Files.java:2742)
      at org.apache.kafka.common.utils.Utils.delete(Utils.java:619)
      at org.apache.kafka.streams.processor.internals.StateDirectory.cleanRemovedTasks(StateDirectory.java:245)
      at org.apache.kafka.streams.KafkaStreams$3.run(KafkaStreams.java:761)
      at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
      at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308)
      at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180)
      at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294)
      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
      at java.lang.Thread.run(Thread.java:745)

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              hana Srini
              Votes:
              4 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: