thomasmueller commented on code in PR #1645:
URL: https://github.com/apache/jackrabbit-oak/pull/1645#discussion_r1718311696
##########
oak-lucene/src/main/java/org/apache/jackrabbit/oak/plugins/index/lucene/LuceneDocumentMaker.java:
##########
@@ -300,18 +300,42 @@ protected boolean indexTypeOrderedFields(Document doc,
String pname, int tag, Pr
fieldAdded = true;
} else {
long now = System.currentTimeMillis();
- if (now > lastDuplicateWarning +
DUPLICATE_WARNING_INTERVAL_MS) {
+ if (now > lastOrderedPropertyWarning +
ORDERED_PROPERTY_WARNING_INTERVAL_MS) {
log.warn("Duplicate value for ordered field {};
ignoring. Possibly duplicate index definition.", f.name());
- lastDuplicateWarning = now;
+ lastOrderedPropertyWarning = now;
}
}
}
} catch (Exception e) {
- log.warn(
- "[{}] Ignoring ordered property. Could not convert
property {} of type {} to type {} for path {}",
- getIndexName(), pname,
- Type.fromTag(property.getType().tag(), false),
- Type.fromTag(tag, false), path, e);
+ boolean unknownWarning = true;
+ String message = e.getMessage();
+ if (message.startsWith("Not a date string") ||
+ message.startsWith("Unable to parse the provided date
field") ||
+ message.startsWith("For input string")) {
Review Comment:
> I don't agree that we should suppress altogether some types of errors
Well, the patch doesn't. It just avoid filling the log file.
> Either the error message is important and should always be logged
(although removing duplicates), or else it is not important and it should not
be logged at all.
I don't see this as a binary thing. We do log a warning if we find a
problem, but we need to avoid logging too much. That is what the patch does.
> From what I saw, the LogSilencer is thread-safe
Ah I didn't see Collections.synchronizedMap sorry.
OK I'll try to use it.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]