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

NoSuchFileException will be thrown if hasPersistentStores is false when creating stateDir

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 2.7.0, 2.6.1
    • 2.8.0, 2.7.1, 2.6.2
    • streams
    • None

    Description

      We improved the state directory folder/file permission setting in KAFKA-10705. But we forgot to consider one situation: if user doesn't have PersistentStores, we won't need to create base dir and state dir. And if there's no such dir/file, and we tried to set permission to them, we'll have NoSuchFileException

       

      ERROR Error changing permissions for the state or base directory /var/folders/4l/393lkmzx3zvftwynjngzdsfw0000gn/T/kafka-11254487964259813330/appId_AdjustStreamThreadCountTestshouldAddStreamThread  (org.apache.kafka.streams.processor.internals.StateDirectory:117)
      2021-01-15T16:10:44.570+0800 [DEBUG] [TestEventLogger]     java.nio.file.NoSuchFileException: /var/folders/4l/393lkmzx3zvftwynjngzdsfw0000gn/T/kafka-11254487964259813330/appId_AdjustStreamThreadCountTestshouldAddStreamThread
      2021-01-15T16:10:44.570+0800 [DEBUG] [TestEventLogger]          at java.base/sun.nio.fs.UnixException.translateToIOException(UnixException.java:92)
      2021-01-15T16:10:44.570+0800 [DEBUG] [TestEventLogger]          at java.base/sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:111)
      2021-01-15T16:10:44.570+0800 [DEBUG] [TestEventLogger]          at java.base/sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:116)
      2021-01-15T16:10:44.570+0800 [DEBUG] [TestEventLogger]          at java.base/sun.nio.fs.UnixFileAttributeViews$Posix.setMode(UnixFileAttributeViews.java:254)
      2021-01-15T16:10:44.570+0800 [DEBUG] [TestEventLogger]          at java.base/sun.nio.fs.UnixFileAttributeViews$Posix.setPermissions(UnixFileAttributeViews.java:276)
      2021-01-15T16:10:44.570+0800 [DEBUG] [TestEventLogger]          at java.base/java.nio.file.Files.setPosixFilePermissions(Files.java:2079)
      2021-01-15T16:10:44.570+0800 [DEBUG] [TestEventLogger]          at org.apache.kafka.streams.processor.internals.StateDirectory.<init>(StateDirectory.java:115)
      

      Attachments

        Activity

          People

            showuon Luke Chen
            showuon Luke Chen
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: