You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tika.apache.org by ta...@apache.org on 2026/08/13 13:33:40 UTC
(tika) 01/01: TIKA-4813: comment-accuracy follow-ups from the tersification review; fix dead X-TIKA:EXCEPTION skip condition (tk: rename)
This is an automated email from the ASF dual-hosted git repository.
tballison pushed a commit to branch TIKA-4813-comment-followups
in repository https://gitbox.apache.org/repos/asf/tika.git
commit 6eb0969391e07bb89cfe24ccad2f9b960f53dbc9
Author: tallison <ta...@apache.org>
AuthorDate: Thu Aug 13 09:33:10 2026 -0400
TIKA-4813: comment-accuracy follow-ups from the tersification review;
fix dead X-TIKA:EXCEPTION skip condition (tk: rename)
---
tika-core/src/main/java/org/apache/tika/config/TimeoutLimits.java | 3 ++-
tika-parent/pom.xml | 2 ++
.../main/java/org/apache/tika/parser/ocr/tess4j/Tess4JParser.java | 4 ++--
.../java/org/apache/tika/server/standard/MetadataResourceTest.java | 6 ++++--
4 files changed, 10 insertions(+), 5 deletions(-)
diff --git a/tika-core/src/main/java/org/apache/tika/config/TimeoutLimits.java b/tika-core/src/main/java/org/apache/tika/config/TimeoutLimits.java
index 5ea79a22fa..eb7994786c 100644
--- a/tika-core/src/main/java/org/apache/tika/config/TimeoutLimits.java
+++ b/tika-core/src/main/java/org/apache/tika/config/TimeoutLimits.java
@@ -150,7 +150,8 @@ public class TimeoutLimits implements Serializable {
/**
* Returns this instance if both timeouts are within {@code maxMillis}, otherwise a
- * copy with each offending timeout reduced to {@code maxMillis}.
+ * copy with each offending timeout reduced to {@code maxMillis}. Used at trust
+ * boundaries to cap request-supplied limits at an operator-set maximum.
*/
public TimeoutLimits clampedTo(long maxMillis) {
if (totalTaskTimeoutMillis <= maxMillis && progressTimeoutMillis <= maxMillis) {
diff --git a/tika-parent/pom.xml b/tika-parent/pom.xml
index 1b9cda63f7..7f45747b4d 100644
--- a/tika-parent/pom.xml
+++ b/tika-parent/pom.xml
@@ -1766,6 +1766,8 @@
<!-- Skip spotless -->
<spotless.apply.skip>true</spotless.apply.skip>
<spotless.check.skip>true</spotless.check.skip>
+ <!-- Skip rat -->
+ <rat.skip>true</rat.skip>
</properties>
</profile>
diff --git a/tika-parsers/tika-parsers-ml/tika-parser-tess4j-module/src/main/java/org/apache/tika/parser/ocr/tess4j/Tess4JParser.java b/tika-parsers/tika-parsers-ml/tika-parser-tess4j-module/src/main/java/org/apache/tika/parser/ocr/tess4j/Tess4JParser.java
index 09bbca9171..2b87ec9d98 100644
--- a/tika-parsers/tika-parsers-ml/tika-parser-tess4j-module/src/main/java/org/apache/tika/parser/ocr/tess4j/Tess4JParser.java
+++ b/tika-parsers/tika-parsers-ml/tika-parser-tess4j-module/src/main/java/org/apache/tika/parser/ocr/tess4j/Tess4JParser.java
@@ -379,8 +379,8 @@ public class Tess4JParser implements Parser, Initializable {
* {@code tesseract} until doOCR returns on its own. {@code settled} arbitrates the pool
* return in that case: giver-upper and worker race to CAS it {@code false -> true}, and
* the loser -- the second to arrive -- returns the instance, so it goes back exactly
- * once. On a normal return or {@link TesseractException} the worker already finished,
- * neither side touched {@code settled}, and the caller retains ownership.
+ * once. On a normal return or {@link TesseractException} the waiter never gave up, so
+ * the worker's CAS wins and it skips the pool return -- the caller retains ownership.
*/
private String doOCRWithTimeout(Tesseract tesseract, BufferedImage image, long requestedMillis,
ParseContext parseContext)
diff --git a/tika-server/tika-server-standard/src/test/java/org/apache/tika/server/standard/MetadataResourceTest.java b/tika-server/tika-server-standard/src/test/java/org/apache/tika/server/standard/MetadataResourceTest.java
index 377fabd41b..0e396af313 100644
--- a/tika-server/tika-server-standard/src/test/java/org/apache/tika/server/standard/MetadataResourceTest.java
+++ b/tika-server/tika-server-standard/src/test/java/org/apache/tika/server/standard/MetadataResourceTest.java
@@ -312,8 +312,10 @@ public class MetadataResourceTest extends CXFTestBase {
for (String name : container.names()) {
// tk:content is absent from both (ignore handler); embedded-only bookkeeping
// differs because /meta stops at the container; tk:resource-name/tk:source-path
- // carry the server's per-request spool filename, so they differ by construction.
- if (name.startsWith("X-TIKA:EXCEPTION") || name.equals("tk:content")
+ // carry the server's per-request spool filename, so they differ by
+ // construction until that is fixed.
+ if (name.startsWith(TikaCoreProperties.TIKA_META_EXCEPTION_PREFIX)
+ || name.equals("tk:content")
|| name.startsWith("tk:parsed-by-full-set")
|| name.equals("tk:resource-name") || name.equals("tk:source-path")
|| name.equals("tk:parse-time-millis")) {