Commit 5ff38262 authored by Sam Thursfield's avatar Sam Thursfield

Merge branch 'wip/carlosg/timeouts-and-stuff' into 'master'

Fixes for race conditions

See merge request !232
parents 747f0acc 7e804a0c
Pipeline #193440 passed with stages
in 10 minutes and 28 seconds
......@@ -252,22 +252,9 @@ crawler_check_directory_contents_cb (TrackerCrawler *crawler,
parent, children);
}
if (process) {
TrackerDirectoryFlags parent_flags;
gboolean add_monitor;
tracker_indexing_tree_get_root (priv->indexing_tree,
parent, &parent_flags);
add_monitor = (parent_flags & TRACKER_DIRECTORY_FLAG_MONITOR) != 0;
if (add_monitor) {
tracker_monitor_add (priv->monitor, parent);
} else {
tracker_monitor_remove (priv->monitor, parent);
}
} else {
if (!process) {
priv->current_index_root->current_dir_content_filtered = TRUE;
tracker_monitor_remove (priv->monitor, parent);
}
return process;
......@@ -529,9 +516,17 @@ crawl_directory_in_current_root (TrackerFileNotifier *notifier)
return FALSE;
while (!g_queue_is_empty (priv->current_index_root->pending_dirs)) {
TrackerDirectoryFlags flags;
directory = g_queue_pop_head (priv->current_index_root->pending_dirs);
priv->current_index_root->current_dir = directory;
tracker_indexing_tree_get_root (priv->indexing_tree,
directory, &flags);
if ((flags & TRACKER_DIRECTORY_FLAG_MONITOR) != 0)
tracker_monitor_add (priv->monitor, directory);
/* Begin crawling the directory non-recursively.
*
* - We receive ::check-file, ::check-directory and ::check-directory-contents signals
......@@ -548,6 +543,7 @@ crawl_directory_in_current_root (TrackerFileNotifier *notifier)
return TRUE;
}
tracker_monitor_remove (priv->monitor, directory);
g_object_unref (directory);
}
......@@ -898,7 +894,8 @@ notifier_queue_root (TrackerFileNotifier *notifier,
priv->pending_index_roots = g_list_append (priv->pending_index_roots, data);
}
notifier_check_next_root (notifier);
if (!priv->current_index_root)
notifier_check_next_root (notifier);
}
/* This function ensures to issue ::file-created for all
......
......@@ -999,6 +999,9 @@ main (gint argc, gchar *argv[])
g_object_unref (connection);
tracker_domain_ontology_unref (domain_ontology);
tracker_sparql_connection_close (sparql_conn);
g_object_unref (sparql_conn);
g_print ("\nOK\n\n");
return EXIT_SUCCESS;
......
......@@ -288,6 +288,7 @@ main (int argc, char **argv)
g_main_loop_run (loop);
g_main_loop_unref (loop);
tracker_sparql_connection_close (sparql_conn);
g_object_unref (sparql_conn);
g_object_unref (endpoint);
g_object_unref (miner);
......
......@@ -462,6 +462,8 @@ main (int argc, char *argv[])
g_object_unref (proxy);
g_object_unref (connection);
tracker_domain_ontology_unref (domain_ontology);
tracker_sparql_connection_close (sparql_connection);
g_object_unref (sparql_connection);
g_object_unref (config);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment