summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLuca Milanesio <luca.milanesio@gmail.com>2021-01-30 00:48:05 +0000
committerLuca Milanesio <luca.milanesio@gmail.com>2021-02-25 23:01:44 +0000
commiteb5eb7527eab368d668ae5471c2da1d3e524af79 (patch)
tree5c4f5fb026224b4da153022bf071f7527b2d781b
parent1bdfec2d4942347c8cdf5215ca0a9c4b9ff72b42 (diff)
Stop SPAMming Gerrit logs with 'Logging context is not empty'
Gerrit v3.1 started SPAMming error_log with a continuous series of warnings that the LoggingContext was not empty at the start of the execution of LoggingContextAwareRunnable. The warning is misleading because it doesn't reflect the situation where the logging context is dirty but just tells that at the start of the execution there is already one of the following elements of the thread-local storage already allocated: - tags - forceLogging - performanceLogging - performanceLogRecords Of the four objects stored in the thread-local storage, the performanceLogRecords is created well before the start of the execution and therefore will always be not null when the Callable wrapper gets invoked. Remove the condition on the performanceLogRecords so that the warning will fire if there is a real context dirty detected, apart from the performanceLogRecords that will be always set to a non-null value. Bug: Issue 12443 Change-Id: I6cf7db36165f7653ddb178f0cabe61faa13696e2
-rw-r--r--java/com/google/gerrit/server/logging/LoggingContext.java5
1 files changed, 1 insertions, 4 deletions
diff --git a/java/com/google/gerrit/server/logging/LoggingContext.java b/java/com/google/gerrit/server/logging/LoggingContext.java
index 36c7e9ee76..8e786fc09f 100644
--- a/java/com/google/gerrit/server/logging/LoggingContext.java
+++ b/java/com/google/gerrit/server/logging/LoggingContext.java
@@ -81,10 +81,7 @@ public class LoggingContext extends com.google.common.flogger.backend.system.Log
}
public boolean isEmpty() {
- return tags.get() == null
- && forceLogging.get() == null
- && performanceLogging.get() == null
- && performanceLogRecords.get() == null;
+ return tags.get() == null && forceLogging.get() == null && performanceLogging.get() == null;
}
public void clear() {