[tracker/tracker-0.10] libtracker-miner: Fix buffer control in TrackerMinerFS
- From: Martyn James Russell <mr src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [tracker/tracker-0.10] libtracker-miner: Fix buffer control in TrackerMinerFS
- Date: Fri, 25 Nov 2011 19:30:41 +0000 (UTC)
commit 8e064123547474bb7c938d8dd85f8211dc16a720
Author: Carlos Garnacho <carlos lanedo com>
Date: Wed Nov 23 18:09:49 2011 +0100
libtracker-miner: Fix buffer control in TrackerMinerFS
Add an explicit check on item_queue_handlers_cb() to check the
sparql buffer status, so it doesn't have an opportunity to clog
it any further.
src/libtracker-miner/tracker-miner-fs.c | 9 +++++++--
1 files changed, 7 insertions(+), 2 deletions(-)
---
diff --git a/src/libtracker-miner/tracker-miner-fs.c b/src/libtracker-miner/tracker-miner-fs.c
index 3fd7538..8a7e89c 100644
--- a/src/libtracker-miner/tracker-miner-fs.c
+++ b/src/libtracker-miner/tracker-miner-fs.c
@@ -2950,7 +2950,7 @@ item_queue_get_progress (TrackerMinerFS *fs,
static gboolean
item_queue_handlers_cb (gpointer user_data)
{
- TrackerMinerFS *fs;
+ TrackerMinerFS *fs = user_data;
GFile *file = NULL;
GFile *source_file = NULL;
GFile *parent;
@@ -2960,7 +2960,12 @@ item_queue_handlers_cb (gpointer user_data)
gboolean keep_processing = TRUE;
gint priority = 0;
- fs = user_data;
+ if (tracker_task_pool_limit_reached (TRACKER_TASK_POOL (fs->priv->sparql_buffer))) {
+ /* Task pool is full, give it a break */
+ fs->priv->item_queues_handler_id = 0;
+ return FALSE;
+ }
+
queue = item_queue_get_next_file (fs, &file, &source_file, &priority);
if (queue == QUEUE_WAIT) {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]