changeset 19984:5ea46ed8c156

fts-tika: Don't crash on 500 errors (caused by 146f6f85d) http_req=NULL here set by http_client_request_send_payload(). Even if it wasn't, the payload wouldn't be there.
author Timo Sirainen <timo.sirainen@dovecot.fi>
date Tue, 05 Apr 2016 16:26:08 +0300
parents 1626b756a2a6
children fdbd96c26d2d
files src/plugins/fts/fts-parser-tika.c
diffstat 1 files changed, 7 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/src/plugins/fts/fts-parser-tika.c	Tue Apr 05 12:05:15 2016 +0300
+++ b/src/plugins/fts/fts-parser-tika.c	Tue Apr 05 16:26:08 2016 +0300
@@ -107,11 +107,13 @@
 		/* Server Error - the problem could be anything (in Tika or
 		   HTTP server or proxy) and might be retriable, but Tika has
 		   trouble processing some documents and throws up this error
-		   every time for those documents. So we try retrying this a
-		   couple of times, but if that doesn't work we'll just ignore
-		   it. */
-		if (http_client_request_try_retry(parser->http_req))
-			return;
+		   every time for those documents.
+
+		   Unfortunately we can't easily re-send the request here,
+		   because we would have to re-send the entire payload, which
+		   isn't available anymore here. So we'd need to indicate
+		   in fts_parser_deinit() that we want to retry.
+		   FIXME: do this in v2.3. For now we'll just ignore it. */
 		i_info("fts_tika: PUT %s failed: %u %s - ignoring",
 		       mail_user_plugin_getenv(parser->user, "fts_tika"),
 		       response->status, response->reason);