You are viewing a plain text version of this content. The canonical link for it is here.
Posted to oak-commits@jackrabbit.apache.org by th...@apache.org on 2023/03/14 14:41:58 UTC
[jackrabbit-oak] branch OAK-10145 created (now 10e7b01620)
This is an automated email from the ASF dual-hosted git repository.
thomasm pushed a change to branch OAK-10145
in repository https://gitbox.apache.org/repos/asf/jackrabbit-oak.git
at 10e7b01620 OAK-10145 Rate limit the Missing provider log messages for IndexUpdate
This branch includes the following new commits:
new 10e7b01620 OAK-10145 Rate limit the Missing provider log messages for IndexUpdate
The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
[jackrabbit-oak] 01/01: OAK-10145 Rate limit the Missing provider log messages for IndexUpdate
Posted by th...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
thomasm pushed a commit to branch OAK-10145
in repository https://gitbox.apache.org/repos/asf/jackrabbit-oak.git
commit 10e7b016207a5c738cbe2618cfd7c396e73930b7
Author: Thomas Mueller <th...@apache.org>
AuthorDate: Tue Mar 14 15:39:59 2023 +0100
OAK-10145 Rate limit the Missing provider log messages for IndexUpdate
---
.../apache/jackrabbit/oak/plugins/index/IndexUpdate.java | 15 ++++++++++++---
1 file changed, 12 insertions(+), 3 deletions(-)
diff --git a/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/IndexUpdate.java b/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/IndexUpdate.java
index 142dabdb91..d73514c0a1 100644
--- a/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/IndexUpdate.java
+++ b/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/IndexUpdate.java
@@ -82,6 +82,10 @@ public class IndexUpdate implements Editor, PathSource {
// This counter is cyclically incremented till indexJcrTypeInvalidLogLimiter and then reset to 0
private static volatile long cyclicExecutionCount = INDEX_JCR_TYPE_INVALID_LOG_LIMITER;
+ // Warnings about missing index providers are rate limitted, so that the log file is not filled with them.
+ // this is the last time such a message was logged (if any).
+ private static volatile long lastMissingProviderMessageTime;
+
/**
* <p>
* The value of this flag determines the behavior of the IndexUpdate when
@@ -330,9 +334,14 @@ public class IndexUpdate implements Editor, PathSource {
// then we don't need to handle missing handler
if (definition.hasProperty(ASYNC_PROPERTY_NAME) && rootState.async == null) {
if (!TYPE_DISABLED.equals(type)) {
- log.warn("Missing provider for nrt/sync index: {} (rootState.async: {}). " +
- "Please note, it means that index data should be trusted only after this index " +
- "is processed in an async indexing cycle.", definition, rootState.async);
+ long now = System.currentTimeMillis();
+ if (now > lastMissingProviderMessageTime + 60 * 1000) {
+ lastMissingProviderMessageTime = now;
+ log.warn("Missing provider for nrt/sync index: {} (rootState.async: {}). " +
+ "Please note, it means that index data should be trusted only after this index " +
+ "is processed in an async indexing cycle. " +
+ "This message is silenced for one minute.", definition, rootState.async);
+ }
}
} else {
rootState.missingProvider.onMissingIndex(type, definition, indexPath);