Skip to content

Commit

Permalink
[FIXED JENKINS-10113] try to work extra hard before giving up the fil…
Browse files Browse the repository at this point in the history
…e deletion.
  • Loading branch information
kohsuke committed Jun 29, 2011
1 parent 599888f commit 2c4516d
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion core/src/main/java/hudson/Util.java
Expand Up @@ -302,7 +302,16 @@ private static void makeWritable(File f) {
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);
}
}

/*
Expand Down

0 comments on commit 2c4516d

Please sign in to comment.