tballison commented on code in PR #4853:
URL: https://github.com/apache/solr/pull/4853#discussion_r3937511779


##########
solr/modules/extraction/src/java/org/apache/solr/handler/extraction/TikaServerExtractionBackend.java:
##########
@@ -273,7 +317,33 @@ InputStream callTikaServer(InputStream inputStream, 
ExtractionRequest request) t
     }
 
     int code = response.getStatus();
-    if (code < 200 || code >= 300) {
+    InputStream responseStream = listener.getInputStream();
+    // Tika 4.x's raw /tika* endpoints (non-recursive) return 422 whenever a 
container-level
+    // exception occurred during parsing -- including a non-aborting one like 
a writeLimit
+    // truncation -- but the body still carries whatever content was 
successfully extracted
+    // (there's no envelope to carry the exception itself on these endpoints; 
use /rmeta for
+    // that). A request that extracted nothing at all (e.g. a wrong password) 
also gets 422, but
+    // with an empty body -- treat that case as the failure it is instead of a 
silent empty
+    // "success". Peek the first byte to tell the two apart.
+    if (code == 422 && !request.tikaServerRecursive) {

Review Comment:
   We moved to default single file per-fork processing. We now have 429 as a 
backpressure signal, if a request can't find an active worker in 30s(?), you'll 
get 429.



-- 
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]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to