Author: bodewig
Date: Fri Jul  9 11:04:49 2010
New Revision: 962483

URL: http://svn.apache.org/viewvc?rev=962483&view=rev
Log:
multiple parallel mkdirs could make each other fail.  PR 49572

Modified:
    ant/core/trunk/WHATSNEW
    ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/Mkdir.java

Modified: ant/core/trunk/WHATSNEW
URL: 
http://svn.apache.org/viewvc/ant/core/trunk/WHATSNEW?rev=962483&r1=962482&r2=962483&view=diff
==============================================================================
--- ant/core/trunk/WHATSNEW (original)
+++ ant/core/trunk/WHATSNEW Fri Jul  9 11:04:49 2010
@@ -96,6 +96,10 @@ Fixed bugs:
    resourcelist in the documentation (getting the first available resource
    from a mirror list).
 
+ * A race condition could lead to build failures if multiple <mkdir>
+   tasks were trying to create the same directory.
+   Bugzilla Report 49572.
+
 Other changes:
 --------------
 

Modified: ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/Mkdir.java
URL: 
http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/Mkdir.java?rev=962483&r1=962482&r2=962483&view=diff
==============================================================================
--- ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/Mkdir.java (original)
+++ ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/Mkdir.java Fri Jul  9 
11:04:49 2010
@@ -59,6 +59,12 @@ public class Mkdir extends Task {
         if (!dir.exists()) {
             boolean result = mkdirs(dir);
             if (!result) {
+                if (dir.exists()) {
+                    log("A different process or task has already created "
+                        + "dir " + dir.getAbsolutePath(),
+                        Project.MSG_VERBOSE);
+                    return;
+                }
                 String msg = "Directory " + dir.getAbsolutePath()
                     + " creation was not successful for an unknown reason";
                 throw new BuildException(msg, getLocation());


Reply via email to