GNOME Bugzilla – Bug 644455
~/.cache/tracker/no-need-mtime-check.txt is not written if tracker-store is stopped before tracker-miner-fs
Last modified: 2011-04-07 13:37:48 UTC
If I stop tracker-store *before* tracker-miner-fs, the file ~/.cache/tracker/no-need-mtime-check.txt is not written by tracker-miner-fs. As a result, on next login, tracker-miner-fs processes a lot of files during the crawling. Steps to reproduce: # Start tracker-store # Start tracker-miner-fs # Stop tracker-store # Stop tracker-miner-fs no-need-mtime-check.txt is *not* written # Start tracker-store # Start tracker-miner-fs tracker-miner-fs does process files
Created attachment 185194 [details] [review] patch Thanks for the bug report, this patch fixes the issue. In the future I think it'd be handy having a TrackerState flags to cater for this, active|paused|initial_index would suffice, although this involves heavier changes across miners.
Comment on attachment 185194 [details] [review] patch >+static gboolean >+store_is_available (void) >+{ >+ gboolean store_available; >+ GDBusConnection *connection; >+ GDBusProxy *proxy; >+ >+ connection = g_bus_get_sync (G_BUS_TYPE_SESSION, NULL, NULL); >+ >+ if (!connection) { >+ return FALSE; >+ } >+ >+ proxy = g_dbus_proxy_new_sync (connection, >+ G_DBUS_PROXY_FLAGS_DO_NOT_AUTO_START, >+ NULL, >+ "org.freedesktop.Tracker1", >+ "/org/freedesktop/Tracker1/Status", >+ "org.freedesktop.Tracker1.Status", >+ NULL, NULL); >+ >+ if (!proxy) { >+ g_object_unref (connection); >+ return FALSE; >+ } >+ >+ store_available = g_dbus_proxy_get_name_owner (proxy); The documentation says this returns a string which we must free. Did you intend to use this API ? Looks like we can just return TRUE instead of call this function. The rest looks really good Carlos, I completely missed that the pausing could be due to the store not being around. Nice catch. Commit once the above issue is resolved ;)
(In reply to comment #2) > >+ > >+ store_available = g_dbus_proxy_get_name_owner (proxy); > > The documentation says this returns a string which we must free. Did you intend > to use this API ? Looks like we can just return TRUE instead of call this > function. oh, ugh, that was a brain fart :), the intention was to check for the name owner not being NULL
I've fixed this and pushed to master