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 2021/12/13 17:25:33 UTC

[GitHub] [kafka] AndyGee commented on a change in pull request #11426: KAFKA-13391: don't fsync directory on Windows OS

AndyGee commented on a change in pull request #11426:
URL: https://github.com/apache/kafka/pull/11426#discussion_r767968720



##########
File path: clients/src/main/java/org/apache/kafka/common/utils/Utils.java
##########
@@ -948,10 +948,12 @@ public static void atomicMoveWithFallback(Path source, Path target, boolean need
     /**
      * Flushes dirty directories to guarantee crash consistency.
      *
+     * Note: We don't fsync directories on Windows OS because otherwise it'll throw AccessDeniedException (KAFKA-13391)
+     *
      * @throws IOException if flushing the directory fails.
      */
     public static void flushDir(Path path) throws IOException {
-        if (path != null) {
+        if (path != null && !OperatingSystem.IS_WINDOWS) {
             try (FileChannel dir = FileChannel.open(path, StandardOpenOption.READ)) {
                 dir.force(true);

Review comment:
       There is a file lock on this file that causes the issue, which might be hiding another issue even on other platforms.




-- 
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.

To unsubscribe, e-mail: jira-unsubscribe@kafka.apache.org

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