From f66c670f257f4b4f3355dcd918681231e0b3aa82 Mon Sep 17 00:00:00 2001 From: kohsuke Date: Tue, 20 May 2008 06:11:14 +0000 Subject: [PATCH] added more debug probe git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@9465 71c3de6d-444a-0410-be80-ed276b4c234a --- core/src/main/java/hudson/Util.java | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/core/src/main/java/hudson/Util.java b/core/src/main/java/hudson/Util.java index ba25ae8317..593c44b601 100644 --- a/core/src/main/java/hudson/Util.java +++ b/core/src/main/java/hudson/Util.java @@ -44,6 +44,7 @@ import java.util.Map; import java.util.ResourceBundle; import java.util.SimpleTimeZone; import java.util.StringTokenizer; +import java.util.Arrays; import java.util.logging.Level; import java.util.logging.Logger; import java.util.regex.Matcher; @@ -173,8 +174,15 @@ public class Util { makeWritable(f.getParentFile()); - if(!f.delete() && f.exists()) + if(!f.delete() && f.exists()) { + // trouble-shooting. + // see http://www.nabble.com/Sometimes-can%27t-delete-files-from-hudson.scm.SubversionSCM%24CheckOutTask.invoke%28%29-tt17333292.html + // I suspect other processes putting files in this directory + File[] files = f.listFiles(); + if(files!=null && files.length>0) + throw new IOException("Unable to delete " + f.getPath()+" - files in dir: "+Arrays.asList(files)); throw new IOException("Unable to delete " + f.getPath()); + } } } -- GitLab