]> source.dussan.org Git - jgit.git/commitdiff
Files should be deleted with "retry" option 61/22461/3
authorMarc Strapetz <marc.strapetz@syntevo.com>
Mon, 24 Feb 2014 17:38:20 +0000 (18:38 +0100)
committerRobin Rosenberg <robin.rosenberg@dewire.com>
Wed, 26 Feb 2014 10:53:56 +0000 (05:53 -0500)
Some of our Windows users have reported sporadic file system access
problems related to ObjectDirectory(Inserter) file deletion code in
combination with antiviral/firewall tools. For one of these users the
problem was fairly reproducible and changing deletion to RETRY solved
his problem.

Change-Id: I1e4001d5557fca693b7bac401268599467cb0c9e
Signed-off-by: Marc Strapetz <marc.strapetz@syntevo.com>‌
org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/ObjectDirectory.java
org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/ObjectDirectoryInserter.java

index 434eadf5fa2a24f21664db45f2f97a7d7549f222..882f5c8a45caaf85cb59d813b70f71f5f4825fc0 100644 (file)
@@ -557,11 +557,11 @@ public class ObjectDirectory extends FileObjectDatabase {
                // If the object is already in the repository, remove temporary file.
                //
                if (unpackedObjectCache.isUnpacked(id)) {
-                       FileUtils.delete(tmp);
+                       FileUtils.delete(tmp, FileUtils.RETRY);
                        return InsertLooseObjectResult.EXISTS_LOOSE;
                }
                if (!createDuplicate && has(id)) {
-                       FileUtils.delete(tmp);
+                       FileUtils.delete(tmp, FileUtils.RETRY);
                        return InsertLooseObjectResult.EXISTS_PACKED;
                }
 
@@ -571,7 +571,7 @@ public class ObjectDirectory extends FileObjectDatabase {
                        // that already exists. We can't be sure renameTo() would
                        // fail on all platforms if dst exists, so we check first.
                        //
-                       FileUtils.delete(tmp);
+                       FileUtils.delete(tmp, FileUtils.RETRY);
                        return InsertLooseObjectResult.EXISTS_LOOSE;
                }
                if (tmp.renameTo(dst)) {
@@ -592,7 +592,7 @@ public class ObjectDirectory extends FileObjectDatabase {
                }
 
                if (!createDuplicate && has(id)) {
-                       FileUtils.delete(tmp);
+                       FileUtils.delete(tmp, FileUtils.RETRY);
                        return InsertLooseObjectResult.EXISTS_PACKED;
                }
 
@@ -601,7 +601,7 @@ public class ObjectDirectory extends FileObjectDatabase {
                // either. We really don't know what went wrong, so
                // fail.
                //
-               FileUtils.delete(tmp);
+               FileUtils.delete(tmp, FileUtils.RETRY);
                return InsertLooseObjectResult.FAILURE;
        }
 
index c55c60a20838770bd7553b61c9310e45f65c60e6..c3e6ad96305d86211fb3ec36fedc9ec1edced5a1 100644 (file)
@@ -182,7 +182,7 @@ class ObjectDirectoryInserter extends ObjectInserter {
                        return tmp;
                } finally {
                        if (delete)
-                               FileUtils.delete(tmp);
+                               FileUtils.delete(tmp, FileUtils.RETRY);
                }
        }
 
@@ -211,7 +211,7 @@ class ObjectDirectoryInserter extends ObjectInserter {
                        return tmp;
                } finally {
                        if (delete)
-                               FileUtils.delete(tmp);
+                               FileUtils.delete(tmp, FileUtils.RETRY);
                }
        }