Skip to content

Commit

Permalink
KAFKA-13391: don't fsync directory on Windows OS (apache#11426)
Browse files Browse the repository at this point in the history
Reviewers: Cong Ding <[email protected]>, Jun Rao <[email protected]>
  • Loading branch information
showuon authored and Ralph Debusmann committed Dec 22, 2021
1 parent e0f5f24 commit 1b9a177
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit 1b9a177

Please sign in to comment.