https://issues.apache.org/bugzilla/show_bug.cgi?id=49572

           Summary: Mkdir task fails if folder exist
           Product: Ant
           Version: 1.8.1
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Core tasks
        AssignedTo: [email protected]
        ReportedBy: [email protected]


Sometimes mkdir task fail when many mkdir task tries to create same folder at
the same file

Steps to Reproduce
Run many mkdir task that crates same folder

Actual Results:
class org.apache.tools.ant.BuildException WITH MESSAGE: Directory XXX was not
successful for an unknown reason

Expected Result:
no build exception

Additional Information:
problem is following part of code:

  if(!dir.exists())
        {
            boolean result = mkdirs(dir);
            if(!result)

not handled scenario:
check if dir exist -> no
after checking if dir exist and before creating folder with mkdirs method other
thread (eg mkdir task) creates folder so result is no but folder exist 
my proposal:
change:

 if(!result)

to 
 if(!result && !dir.exists()){
}else if (dir.exists()){
log("folder exist")
}

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

Reply via email to