aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLuca Milanesio <luca.milanesio@gmail.com>2025-01-29 10:17:17 +0000
committerLuca Milanesio <luca.milanesio@gmail.com>2025-01-29 14:34:10 +0000
commit772ee0e5fb9fbfb4a82ceb872e187abf62a4b453 (patch)
tree9fc0abb5c1335095f6c7bdc3d85392a7ad163e32
parent517a7b210fba00661bf42e3d4bc473cc1428c93b (diff)
downloadjgit-772ee0e5fb9fbfb4a82ceb872e187abf62a4b453.tar.gz
jgit-772ee0e5fb9fbfb4a82ceb872e187abf62a4b453.zip
Log pruned packfiles as debug and not warn logs
In the regular lifecycle of a Git repository, the packfiles are constantly created and removed as part of repacking and pruning. Lower the logging of disappearing packfiles to debug level to reduce the SPAMing on logfile with warnings that should be ignored as part of the normal repository life. Change-Id: I57b24ffb0b32f7a64810cab47b5009f2bf89a6b8
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/PackDirectory.java6
1 files changed, 5 insertions, 1 deletions
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/PackDirectory.java b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/PackDirectory.java
index e31126f027..706dbd6281 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/PackDirectory.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/PackDirectory.java
@@ -314,6 +314,7 @@ class PackDirectory {
private void handlePackError(IOException e, Pack p) {
String warnTmpl = null;
+ String debugTmpl = null;
int transientErrorCount = 0;
String errTmpl = JGitText.get().exceptionWhileReadingPack;
if ((e instanceof CorruptObjectException)
@@ -328,7 +329,7 @@ class PackDirectory {
errTmpl = JGitText.get().packInaccessible;
transientErrorCount = p.incrementTransientErrorCount();
} else {
- warnTmpl = JGitText.get().packWasDeleted;
+ debugTmpl = JGitText.get().packWasDeleted;
remove(p);
}
} else if (FileUtils.isStaleFileHandleInCausalChain(e)) {
@@ -340,6 +341,9 @@ class PackDirectory {
if (warnTmpl != null) {
LOG.warn(MessageFormat.format(warnTmpl,
p.getPackFile().getAbsolutePath()), e);
+ } else if (debugTmpl != null) {
+ LOG.debug(MessageFormat.format(debugTmpl,
+ p.getPackFile().getAbsolutePath()), e);
} else {
if (doLogExponentialBackoff(transientErrorCount)) {
// Don't remove the pack from the list, as the error may be