From 49f527386723ff219de0c726d74f200d89c959d7 Mon Sep 17 00:00:00 2001 From: Matthias Sohn Date: Wed, 22 Feb 2023 19:27:30 +0100 Subject: [PATCH] Don't swallow IOException in GC.PidLock#lock This broke the test GcConcurrentTest#testInterruptGc which expects ClosedByInterruptException when the thread doing gc is interrupted. Change-Id: I89e02fc37aceeccb04c20cfc5b71cb8fa21793d6 --- .../src/org/eclipse/jgit/internal/storage/file/GC.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/GC.java b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/GC.java index 04c8418f6..7feb50688 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/GC.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/GC.java @@ -1631,7 +1631,7 @@ private class PidLock implements AutoCloseable { pidFile = repo.getDirectory().toPath().resolve(GC_PID); } - boolean lock() { + boolean lock() throws IOException { if (Files.exists(pidFile)) { Instant mtime = FS.DETECTED .lastModifiedInstant(pidFile.toFile()); @@ -1670,7 +1670,7 @@ boolean lock() { JGitText.get().closePidLockFailed, pidFile), e1); } - return false; + throw e; } return true; }