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 2022/05/17 13:52:56 UTC

[jackrabbit-oak] branch OAK-9758 created (now 0021d83dd2)

This is an automated email from the ASF dual-hosted git repository.

thomasm pushed a change to branch OAK-9758
in repository https://gitbox.apache.org/repos/asf/jackrabbit-oak.git


      at 0021d83dd2 OAK-9758 Oak run indexing silently broken without tika.jar (text rendition)

This branch includes the following new commits:

     new 0021d83dd2 OAK-9758 Oak run indexing silently broken without tika.jar (text rendition)

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-9758 Oak run indexing silently broken without tika.jar (text rendition)

Posted by th...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

thomasm pushed a commit to branch OAK-9758
in repository https://gitbox.apache.org/repos/asf/jackrabbit-oak.git

commit 0021d83dd296728d883d52dc5881d63288d647b7
Author: Thomas Mueller <th...@apache.org>
AuthorDate: Tue May 17 15:52:40 2022 +0200

    OAK-9758 Oak run indexing silently broken without tika.jar (text rendition)
---
 .../jackrabbit/oak/plugins/tika/TextExtractor.java  | 21 ++++++++-------------
 .../spi/binary/FulltextBinaryTextExtractor.java     | 21 ++++++++-------------
 2 files changed, 16 insertions(+), 26 deletions(-)

diff --git a/oak-run/src/main/java/org/apache/jackrabbit/oak/plugins/tika/TextExtractor.java b/oak-run/src/main/java/org/apache/jackrabbit/oak/plugins/tika/TextExtractor.java
index e84858b7dc..1083bf369a 100644
--- a/oak-run/src/main/java/org/apache/jackrabbit/oak/plugins/tika/TextExtractor.java
+++ b/oak-run/src/main/java/org/apache/jackrabbit/oak/plugins/tika/TextExtractor.java
@@ -79,8 +79,6 @@ class TextExtractor implements Closeable {
     private boolean initialized;
     private BinaryStats stats;
     private boolean closed;
-    private boolean linkageErrorFound;
-    private boolean throwableErrorFound;
 
     public TextExtractor(TextWriter textWriter) {
         this.textWriter = textWriter;
@@ -272,11 +270,10 @@ class TextExtractor implements Closeable {
             // not being present. This is equivalent to disabling
             // selected media types in configuration, so we can simply
             // ignore these errors.
-            String format = "Failed to extract text from a binary property: {}."
-                            + " This often happens when some media types are disabled by configuration."
-                            + " The stack trace is included to flag some 'unintended' failures";
-            log.warn(format, linkageErrorFound ? path : new Object[]{path, e});
-            linkageErrorFound = true;
+            String format = "Failed to extract text from a binary property: {}. "
+                            + "This often happens when the media types is disabled by configuration.";
+            log.info(format, path);
+            log.debug(format, path, e);
             parserErrorCount.incrementAndGet();
             return ERROR_TEXT;
         } catch (Throwable t) {
@@ -284,12 +281,10 @@ class TextExtractor implements Closeable {
             // The special STOP exception is used for normal termination.
             if (!handler.isWriteLimitReached(t)) {
                 parserErrorCount.incrementAndGet();
-                String format = "Failed to extract text from a binary property: {}"
-                        + " This is a fairly common case, and nothing to"
-                        + " worry about. The stack trace is included to"
-                        + " help improve the text extraction feature.";
-                parserError.info(format, throwableErrorFound ? path : new Object[]{path, t});
-                throwableErrorFound = true;
+                String format = "Failed to extract text from a binary property: {}. "
+                        + "This is quite common, and usually nothing to worry about.";
+                parserError.info(format, path);
+                parserError.debug(format, path, t);
                 return ERROR_TEXT;
             } else {
                 parserError.debug("Extracted text size exceeded configured limit({})", maxExtractedLength);
diff --git a/oak-search/src/main/java/org/apache/jackrabbit/oak/plugins/index/search/spi/binary/FulltextBinaryTextExtractor.java b/oak-search/src/main/java/org/apache/jackrabbit/oak/plugins/index/search/spi/binary/FulltextBinaryTextExtractor.java
index dfbac5b549..555ef82368 100644
--- a/oak-search/src/main/java/org/apache/jackrabbit/oak/plugins/index/search/spi/binary/FulltextBinaryTextExtractor.java
+++ b/oak-search/src/main/java/org/apache/jackrabbit/oak/plugins/index/search/spi/binary/FulltextBinaryTextExtractor.java
@@ -74,8 +74,6 @@ public class FulltextBinaryTextExtractor {
   private final boolean reindex;
   private Parser parser;
   private TikaConfigHolder tikaConfig;
-  private boolean linkageErrorFound;
-  private boolean throwableErrorFound;
   /**
    * The media types supported by the parser used.
    */
@@ -177,13 +175,12 @@ public class FulltextBinaryTextExtractor {
       // not being present. This is equivalent to disabling
       // selected media types in configuration, so we can simply
       // ignore these errors.
-      String format = "[{}] Failed to extract text from a binary property: {}."
-              + " This often happens when some media types are disabled by configuration."
-              + " The stack trace is included to flag some 'unintended' failures";
+      String format = "[{}] Failed to extract text from a binary property: {}. "
+                + "This often happens when the media types is disabled by configuration.";
       String indexName = getIndexName();
-      log.warn(format, linkageErrorFound ? new Object[]{indexName, path} : new Object[]{indexName, path, e});
+      log.info(format, indexName, path);
+      log.debug(format, indexName, path, e);
       extractedTextCache.put(v, ExtractedText.ERROR);
-      linkageErrorFound = true;
       return TEXT_EXTRACTION_ERROR;
     } catch (TimeoutException t) {
       log.warn(
@@ -196,14 +193,12 @@ public class FulltextBinaryTextExtractor {
       // Capture and report any other full text extraction problems.
       // The special STOP exception is used for normal termination.
       if (!handler.isWriteLimitReached(t)) {
-        String format = "[{}] Failed to extract text from a binary property: {}."
-                + " This is a fairly common case, and nothing to"
-                + " worry about. The stack trace is included to"
-                + " help improve the text extraction feature.";
+        String format = "[{}] Failed to extract text from a binary property: {}. "
+                  + "This is quite common, and usually nothing to worry about.";
         String indexName = getIndexName();
-        log.info(format, throwableErrorFound ? new Object[]{indexName, path} : new Object[]{indexName, path, t});
+        log.info(format, indexName, path);
+        log.debug(format, indexName, path, t);
         extractedTextCache.put(v, ExtractedText.ERROR);
-        throwableErrorFound = true;
         return TEXT_EXTRACTION_ERROR;
       } else {
         log.debug("Extracted text size exceeded configured limit({})", definition.getMaxExtractLength());