[tracker] tracker-miner-fs: Use 60s as default DBus timeout for requests to extractor



commit 7e5b25a1c04f2d376b2b62833f3a37bcf898a37c
Author: Aleksander Morgado <aleksander lanedo com>
Date:   Thu Jul 8 18:44:00 2010 +0200

    tracker-miner-fs: Use 60s as default DBus timeout for requests to extractor

 src/miners/fs/tracker-miner-files.c |   13 +++++++++++++
 1 files changed, 13 insertions(+), 0 deletions(-)
---
diff --git a/src/miners/fs/tracker-miner-files.c b/src/miners/fs/tracker-miner-files.c
index 9ca41ea..36e01f3 100644
--- a/src/miners/fs/tracker-miner-files.c
+++ b/src/miners/fs/tracker-miner-files.c
@@ -58,6 +58,9 @@
  */
 #define N_DAYS_THRESHOLD 3
 
+/* Default DBus timeout to be used in requests to extractor (milliseconds) */
+#define EXTRACTOR_DBUS_TIMEOUT 60000
+
 #define TRACKER_MINER_FILES_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), TRACKER_TYPE_MINER_FILES, TrackerMinerFilesPrivate))
 
 static GQuark miner_files_error_quark = 0;
@@ -1811,6 +1814,16 @@ extractor_create_proxy (DBusGConnection *connection)
 
 	if (!proxy) {
 		g_critical ("Could not create a DBusGProxy to the extract service");
+	} else {
+		/* Set default timeout for DBus requests to be around 60s.
+		 * Assuming that the files which need more time to get extracted are PDFs
+		 * using libpoppler, we already have a limit in the PDF extractor not to
+		 * spend more than 5s extraction contents. And, assuming the default
+		 * value of 10 in process-pool-limit, it means we may end up queueing up
+		 * to 10 PDF files which may need 5s each, so in order not to have dbus
+		 * timeouts in this case, any value greater than 5*10 would be good.
+		 */
+		dbus_g_proxy_set_default_timeout (proxy, EXTRACTOR_DBUS_TIMEOUT);
 	}
 
 	return proxy;



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]