After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 644455 - ~/.cache/tracker/no-need-mtime-check.txt is not written if tracker-store is stopped before tracker-miner-fs
~/.cache/tracker/no-need-mtime-check.txt is not written if tracker-store is s...
Status: RESOLVED FIXED
Product: tracker
Classification: Core
Component: Miners
0.10.x
Other Linux
: Normal normal
: ---
Assigned To: tracker-general
Jamie McCracken
Depends on:
Blocks:
 
 
Reported: 2011-03-10 23:26 UTC by Michael Biebl
Modified: 2011-04-07 13:37 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
patch (6.87 KB, patch)
2011-04-05 12:40 UTC, Carlos Garnacho
needs-work Details | Review

Description Michael Biebl 2011-03-10 23:26:38 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
Comment 1 Carlos Garnacho 2011-04-05 12:40:11 UTC
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 2 Martyn Russell 2011-04-06 15:47:31 UTC
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 ;)
Comment 3 Carlos Garnacho 2011-04-07 12:38:16 UTC
(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
Comment 4 Carlos Garnacho 2011-04-07 13:37:48 UTC
I've fixed this and pushed to master