瀏覽代碼

HADOOP-4377. Fix a race condition in directory creation in
NativeS3FileSystem. Contributed by David Phillips.


git-svn-id: https://svn.apache.org/repos/asf/hadoop/core/trunk@712311 13f79535-47bb-0310-9956-ffa450edef68

Christopher Douglas 16 年之前
父節點
當前提交
26d5d1ece8
共有 2 個文件被更改,包括 4 次插入1 次删除
  1. 3 0
      CHANGES.txt
  2. 1 1
      src/core/org/apache/hadoop/fs/s3native/NativeS3FileSystem.java

+ 3 - 0
CHANGES.txt

@@ -101,6 +101,9 @@ Trunk (unreleased changes)
     HADOOP-4530. In fsck, HttpServletResponse sendError fails with
     IllegalStateException. (hairong)
 
+    HADOOP-4377. Fix a race condition in directory creation in
+    NativeS3FileSystem. (David Phillips via cdouglas)
+
 Release 0.19.0 - Unreleased
 
   INCOMPATIBLE CHANGES

+ 1 - 1
src/core/org/apache/hadoop/fs/s3native/NativeS3FileSystem.java

@@ -148,7 +148,7 @@ public class NativeS3FileSystem extends FileSystem {
 
     private File newBackupFile() throws IOException {
       File dir = new File(conf.get("fs.s3.buffer.dir"));
-      if (!dir.exists() && !dir.mkdirs()) {
+      if (!dir.mkdirs() && !dir.exists()) {
         throw new IOException("Cannot create S3 buffer directory: " + dir);
       }
       File result = File.createTempFile("output-", ".tmp", dir);