Skip to content

armgit / solr

Public Imported from GitHub
0

Apache Solr open-source search software

TikaServerExtractionBackend now sets idleTimeout (#3926)

Jan Høydahl160076dad1a0
diff --git a/changelog/unreleased/tika-server-idle-timeout-fix.yml b/changelog/unreleased/tika-server-idle-timeout-fix.yml
new file mode 100644
index 00000000000..36d2206609e
--- /dev/null
+++ b/changelog/unreleased/tika-server-idle-timeout-fix.yml
@@ -0,0 +1,9 @@
+# See https://github.com/apache/solr/blob/main/dev-docs/changelog.adoc
+title: When using SolrCell with TikaServer, the connection will no longer timeout after 30s idle, such as during OCR processing
+type: fixed # added, changed, fixed, deprecated, removed, dependency_update, security, other
+authors:
+ - name: Jan Høydahl
+ url: https://home.apache.org/phonebook.html?uid=janhoy
+links:
+ - name: SOLR-XXXX
+ url: https://issues.apache.org/jira/browse/SOLR-XXXX
diff --git a/solr/modules/extraction/src/java/org/apache/solr/handler/extraction/TikaServerExtractionBackend.java b/solr/modules/extraction/src/java/org/apache/solr/handler/extraction/TikaServerExtractionBackend.java
index 807e3305826..c21a0c01e09 100644
--- a/solr/modules/extraction/src/java/org/apache/solr/handler/extraction/TikaServerExtractionBackend.java
+++ b/solr/modules/extraction/src/java/org/apache/solr/handler/extraction/TikaServerExtractionBackend.java
@@ -180,6 +180,8 @@ public class TikaServerExtractionBackend implements ExtractionBackend {
? Duration.ofSeconds(request.tikaServerTimeoutSeconds)
: defaultTimeout;
req.timeout(effectiveTimeout.toMillis(), TimeUnit.MILLISECONDS);
+ // Also set idle timeout in case of heavy server side work like OCR
+ req.idleTimeout(effectiveTimeout.toMillis(), TimeUnit.MILLISECONDS);
// Headers
String accept = (request.tikaServerRecursive ? "application/json" : "text/xml");