[FIXED JENKINS-10113] try to work extra hard before giving up the file deletion.

This commit is contained in:
Kohsuke Kawaguchi committed 2011-06-28 22:18:36 -07:00
1 parent 599888fec1
commit 2c4516dcf2
1 file changed
+10 -1
+10 -1
View File
@@ -302,7 +302,16 @@ public class Util {
public static void deleteRecursive(File dir) throws IOException {
if(!isSymlink(dir))
deleteContentsRecursive(dir);
deleteFile(dir);
try {
deleteFile(dir);
} catch (IOException e) {
// if some of the child directories are big, it might take long enough to delete that
// it allows others to create new files, causing problemsl ike JENKINS-10113
// so give it one more attempt before we give up.
if(!isSymlink(dir))
deleteContentsRecursive(dir);
deleteFile(dir);
}
}
/*