[tracker] tracker-miner-fs: Fix a completion check when removing the final task



commit d12df896c16b91d185ee821b2eab506bfc2c6a42
Author: Philip Withnall <philip withnall collabora co uk>
Date:   Thu Jun 18 19:12:22 2015 +0100

    tracker-miner-fs: Fix a completion check when removing the final task
    
    Depending on how mining goes, this path might be the last one taken
    before the miner is ready to go idle again. However, the check on the
    task pool size is guaranteed to be false because the task which
    item_add_or_update_continue() was called on has not yet been removed
    from the pool — that’s done directly below.
    
    Fix that by removing the task from the task pool before checking whether
    the pool is empty.
    
    This fixes stalls in tracker-miner-fs where `tracker-control -S` would
    show the following for ever (when running with
    index-recursive-directories set to a non-empty list):
       1%  File System - Crawl finished for directory 'blah'
    
    Previously, the only way to fix this was to pause and then resume the
    miner.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=751172

 src/libtracker-miner/tracker-miner-fs.c |   12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)
---
diff --git a/src/libtracker-miner/tracker-miner-fs.c b/src/libtracker-miner/tracker-miner-fs.c
index 435c0b6..83860f8 100644
--- a/src/libtracker-miner/tracker-miner-fs.c
+++ b/src/libtracker-miner/tracker-miner-fs.c
@@ -1455,12 +1455,6 @@ item_add_or_update_continue (TrackerMinerFS *fs,
                }
        }
 
-       if (tracker_miner_fs_has_items_to_process (fs) == FALSE &&
-           tracker_task_pool_get_size (TRACKER_TASK_POOL (fs->priv->task_pool)) == 0) {
-               /* We need to run this one more time to trigger process_stop() */
-               item_queue_handlers_set_up (fs);
-       }
-
        /* Last reference is kept by the pool, removing the task from
         * the pool cleans up the task too!
         *
@@ -1470,6 +1464,12 @@ item_add_or_update_continue (TrackerMinerFS *fs,
         */
        tracker_task_pool_remove (fs->priv->task_pool, task);
 
+       if (tracker_miner_fs_has_items_to_process (fs) == FALSE &&
+           tracker_task_pool_get_size (TRACKER_TASK_POOL (fs->priv->task_pool)) == 0) {
+               /* We need to run this one more time to trigger process_stop() */
+               item_queue_handlers_set_up (fs);
+       }
+
        g_free (uri);
 }
 


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