summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Update meson build system for libtracker-direct changeswip/sam/carlosg/direct-rewriteSam Thursfield2018-07-163-14/+5
|
* libtracker-direct: Remove unused variablesSam Thursfield2018-07-161-2/+1
|
* tracker-store: Use TrackerDirectConnection underneathCarlos Garnacho2018-07-165-424/+117
| | | | | | | | | | | | | | | Instead of the lower level TrackerDataManager object directly. The only additional thing that tracker-store does is signal emission for writeback and GraphUpdated, the internal TrackerDataManager object is still accessed to implement those features. This makes libtracker-direct the only place where queries/updates are queued, performed and dispatched. There's other indirect benefit from this, update queue handling no longer needs to hit the main thread in order to schedule the next update. Besides the very unlikely thread contention situations described in previous commits, this should maximize throughput of the updates queue.
* libtracker-data: Move notify_transaction() down to libtracker-dataCarlos Garnacho2018-07-164-19/+3
| | | | | | | | | | | Now that we don't need upper layers' information to find out the right CommitType, push this call down together with the handling of the insert/delete/rollback callbacks. One particularity is that the commit callbacks will now be called from within the update thread, just like all the other callbacks. And this is fine, with all the preparation work from the previous commits.
* tracker-store: Push TrackerData hooks down to Tracker.StoreCarlos Garnacho2018-07-165-97/+116
| | | | | | | | | | | | | | | | | | | | | | Move this out of the Resources object, which is basically a view of the internal Store object. All event accounting and signaling is now performed by the Store object, to which the Resources DBus object connects to in order to implement GraphUpdated and Writeback signals. Only one handler of these events is possible at the moment, would be nice to consider doing something marginally better on the Steroids interface at some point, at least wrt the amount of data sent through the bus. Instead of trying to schedule the timeout across threads (the TrackerData hooks run in the thread performing the updates, and we want signaling done from the main/dbus thread), the code now just sets up a timeout on the main thread that keeps running as long as there are pending updates. When the task for the last batched update returns, it will be safe for the timeout to do signaling one last time and turn itself down, all of this happening in the main thread.
* tracker-store: Protect ready writeback events with mutexCarlos Garnacho2018-07-161-0/+11
| | | | | | | | | Just like with ready GraphUpdated events, this will be potentially accessed by both the thread performing updates, and the thread doing the DBus dispatching and signaling. Just like there, the chances of contention are rather low, since emission is checked just once per second by default.
* tracker-store: Refactor writeback signal emission into separate functionCarlos Garnacho2018-07-161-21/+24
| | | | Purely cosmetic.
* tracker-store: Give ownership of writeback events on get_ready()Carlos Garnacho2018-07-163-6/+9
| | | | | | Instead of doing get_ready() and then reset_ready(), just give ownership of the events hashtable on get_ready() while resetting the internal one.
* tracker-store: Protect event batches with a mutexCarlos Garnacho2018-07-164-18/+20
| | | | | | | | | | While the pending data and event counter are only accessed by the updates thread, the ready events will be potentially accessed by both the updates and the dbus thread. That said, chances of locking will be minimal, since the get_pending() call only happens once a second (by default) or after the pending buffer grew big enough.
* tracker-store: Do immediate GraphUpdated emission checks on commit hookCarlos Garnacho2018-07-161-3/+5
| | | | | | | | | | | | | | Triggering those on insert/delete callbacks isn't right for two reasons: there could still be a rollback of the just notified data, and it's done from the wrong thread (the one performing updates instead of the main thread). To fix the first, only call this from the commit hook, we can only notify of data that was successfully stored. To fix the second, do the call on an idle that will ensure the main thread running the main loop and doing the DBus dispatching is the one handling the actual emission. At the moment the commit hook is actually executed on that same thread, but that won't stay as-is.
* libtracker-data: Move TrackerClass event maintenance to tracker-storeCarlos Garnacho2018-07-168-412/+339
| | | | | | | This is solely used by tracker-store to keep the backlog of pending GraphUpdated events. This event tracking can move to tracker-store itself, implemented atop libtracker-data's insert/delete/commit/rollback callbacks.
* libtracker-data: Drop CommitTypeCarlos Garnacho2018-07-165-76/+13
| | | | | | | | | | | This basically exists to allow deferring GraphUpdated signals while there's pending batch updates. This is arguably wrong, the priorities should totally affect the order in which updates are processed, but for the sake of interactivity once the data is in the database it makes sense to let the users know ASAP. Now all commits shall set up a timer for GraphUpdated emission is none is set yet.
* libtracker-direct: Add sync() callCarlos Garnacho2018-07-163-12/+52
| | | | This will flush all updates and trigger the WAL hook.
* libtracker-direct: Add internal function to set additional DBManager flagsCarlos Garnacho2018-07-163-1/+12
| | | | | | This will be useful for tracker-store, and the flags that make sense there don't make as much sense to add to the public TrackerSparqlConnectionFlags set.
* libtracker-data: Remove TRACKER_DB_MANAGER_REMOVE_CACHE flagCarlos Garnacho2018-07-163-8/+5
| | | | | It's unused and unhandled. As the TrackerDBManager type is internal API, just remove the flag and shuffle the numbers.
* tracker-store: Do not freeze events during TTL loadCarlos Garnacho2018-07-164-27/+1
|
* libtracker-direct: Add internal TrackerDataManager getterCarlos Garnacho2018-07-163-0/+13
| | | | | | This will make internal users able to access all the gory details that TrackerDataManager has to offer. Will help deduplicate code in tracker-store that is essentially the same than this.
* libtracker-direct: Rewrite in CCarlos Garnacho2018-07-167-453/+893
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In today's chapter of gratuituous rewrites. The instigator of this rewrite is vala's bug https://bugzilla.gnome.org/show_bug.cgi?id=789249. One might argue that bugs are bugs and eventually get fixed, but there's two things that make me think it won't happen soon: - Vala behavior of possibly iterating the main loop from the async task until the task is complete is very much deliberate in order to support the Generator pattern without a main loop, as seen at: https://wiki.gnome.org/Projects/Vala/AsyncSamples#Generator_example - OTOH, glib docs specify that a GAsyncReadyCallback must happen at a later iteration of the main context, presumably to ensure the task is not finished before the async function dispatching the task returns. This is precisely what trips Vala into starting the same task again. I don't see either changing anytime soon, and in the mean time Tracker is largely affected by it, both in perceived bugs (All those nie:url constraint warnings out of the blue had a reason, this) and in real bugs (It's sometimes attempting to insert things twice, and it may even succeed if the query does not break any cardinality/unique constraints). This affects Tracker in too fundamental ways to just shrug it away, unlike the Vala code this C/glib code works just as it looks. Now about the code... It's a pretty boring rewrite, there's a thread pool to dispatch select queries, and a single exclusive thread to handle updates. The WAL hook can possibly use an additional thread to perform non-blocking writes. All very much alike the older code. Future commits will make tracker-store use this connection implementation, so there's only this piece of code handling SPARQL updates.
* Merge branch 'sam/functional-tests'Sam Thursfield2018-07-16103-3425/+248
|\ | | | | | | See https://gitlab.gnome.org/GNOME/tracker/merge_requests/7
| * Honour TRACKER_DB_ONTOLOGIES_DIR override more logicallysam/functional-testsSam Thursfield2018-07-161-7/+12
| | | | | | | | | | | | Previously, we would ignore this environment variable unless the installed directory didn't exist. This meant that one of the functional tests would stop working once you ran `make install`...
| * functional-tests: Autotools now runs functional tests against source treeSam Thursfield2018-07-163-8/+19
| | | | | | | | This is how Meson already behaves.
| * functional-tests/09-concurrent-query.py: Print error on failureSam Thursfield2018-07-161-3/+3
| | | | | | | | | | | | | | | | | | Previously you would get this error on failure: Traceback (most recent call last): File "/usr/lib64/python2.7/site-packages/gi/overrides/Gio.py", line 158, in __async_result_handler error_callback(obj, e, real_user_data) TypeError: error_handler() takes exactly 1 argument (4 given)
| * tests: Turn gb-737023 test into a functional-testSam Thursfield2018-07-164-3/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is really testing the IPC methods, so it should go with the other IPC tests which talk to a real tracker-store instance. Now the test is isolated from the user's real data, as it runs through the functional test-runner.sh script. It does still use the tracker-store from the system rather than the one we just built though, more work is needed there. The test sometimes fails due to the tracker-store disconnecting from it and GDBus triggering a SIGTERM due to the exit-on-close option being enabled on the GDBusConnection. I'm not sure how to fix that, there is an open bug here: https://gitlab.gnome.org/GNOME/tracker/issues/18
| * functional-tests/200-backup-restore.py: Delete this testSam Thursfield2018-07-163-328/+1
| | | | | | | | | | | | The backup API appears to be totally broken. There aren't any good use cases for this, it's a legacy from the Maemo days. The plan is to deprecate and remove it, so let's start by deleting the test.
| * functional-tests/17-ontology-changes.py: Disable most testsSam Thursfield2018-07-1689-3055/+171
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This removes the TrackerSystemAbstraction class (or rather merges it into 17-ontology-changes.py, which was the only real user in this repo). Something seems very broken about the ontology updates code in Tracker; most of the tests are failing even though they should not. We aren't doing many ontology changes so this is not the highest priority issue right now. I have tidied up the code quite a lot for the testcase, more work is needed to make things actually simple to debug. I'd recommend using tracker_sparql_connection_new_local() instead of starting a new external store process so that the problems can be more easily debugged. functional-tests: Mark test which is known to be unsupported
| * functional-tests/13-threaded-store.py: Disable failing testSam Thursfield2018-07-161-0/+1
| | | | | | | | | | | | This test causes a parser stack overflow. Carlos is nearly done on a branch which rewrites the parser so there probably isn't much point tracking down this issue in the old code.
| * functional-tests/13-threaded-store.py: Remove obsolete importSam Thursfield2018-07-161-2/+1
| |
| * functional-tests/03-fts-functions.py: Skip failing test, for now.Sam Thursfield2018-07-161-3/+4
| | | | | | | | | | | | I don't know what's wrong with this, and I want to prioritize having the functional tests run on every commit rather than fixing every small issue with them.
| * functional-tests: Disable sqlite-misused tests as they are super slowSam Thursfield2018-07-161-4/+5
| |
| * functional-tests: Disable IPC tests that don't workSam Thursfield2018-07-161-8/+0
| | | | | | | | It's not clear what these are for.
| * functional-tests: Avoid crash when TRACKER_TESTS_VERBOSE is setSam Thursfield2018-07-161-1/+4
| |
| * functional-tests: Add missing environment variableSam Thursfield2018-07-161-0/+1
| | | | | | | | This fixes tests that were trying to load the generated .ttl files.
| * ci: Enable functional testsSam Thursfield2018-07-161-2/+3
| | | | | | | | | | PyGI is now needed as an extra dependency. Note that the functional tests still use Python 2
| * ci: Avoid dumping screenfuls of CI_ variables for each failed testSam Thursfield2018-07-161-1/+7
|/
* ci: Fix job names to be consistentSam Thursfield2018-07-161-1/+1
|
* Merge branch 'sam/ci-custom-base-image'Sam Thursfield2018-07-161-60/+4
|\ | | | | | | See https://gitlab.gnome.org/GNOME/tracker/merge_requests/8
| * ci: Use a custom base image with packages we need preinstalledSam Thursfield2018-07-161-60/+4
|/ | | | | The images are built from this project: https://gitlab.gnome.org/samthursfield/tracker-oci-images
* Update Polish translationPiotr Drąg2018-07-151-64/+56
|
* Restore Unicode quotation marks in a translatable stringPiotr Drąg2018-07-151-1/+1
| | | | | | Fixes regression in commit b458fda8fa03f5ec53f8de9edfeef1b7610aae9c. See https://developer.gnome.org/hig/stable/typography.html
* Merge branch 'sam/resource-jsonld'Sam Thursfield2018-07-1510-6/+212
|\ | | | | | | See https://gitlab.gnome.org/GNOME/tracker/merge_requests/3
| * Add support to TrackerResource for outputting metadata as JSON-LDsam/resource-jsonldSam Thursfield2018-07-159-5/+211
| | | | | | | | | | This also adds `tracker extract -o json` to dump resources in JSON-LD, in anticipation of corresponding updates in tracker-miners.git.
| * Bump version numberSam Thursfield2018-07-151-1/+1
|/ | | | | This allows tracker-miners to check that it's being built against a version of tracker that provides necessary new API.
* Merge branch 'sam/tracker-miner-fs-test-fixes'Sam Thursfield2018-07-153-42/+84
|\ | | | | | | See https://gitlab.gnome.org/GNOME/tracker/issues/15
| * libtracker-miner: Warn when overwriting tasks in the task poolsam/tracker-miner-fs-test-fixesSam Thursfield2018-07-151-0/+11
| | | | | | | | | | | | | | | | | | The TrackerTaskPool class and its subclass TrackerSparqlBuffer are designed to contain only one task for any given GFile. If multiple tasks are pushed for the same file some of them might not be executed. This leads to issues such as: https://gitlab.gnome.org/GNOME/tracker/issues/15
| * libtracker-miner/tracker-miner-fs.c: Fix "Parent not indexed yet" errorsSam Thursfield2018-07-151-34/+65
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Commit cef502e668a640 ("Add TrackerMinerFS::move-file vmethod") introduced a regression which sometimes led to errors like this: Tracker-FATAL-WARNING: Parent 'file:///tmp/tracker-miner-fs-test-77E2LZ/recursive/4' not indexed yet This was causing tracker-miner-fs-test to fail in some cases. TrackerTaskPool assumes that there is only one task in the pool per GFile. When processing item_move() operations this wasn't true because we'd create one task for removing the existing dest_file, and another task for updating the URL of source_file to point to dest_file. Both tasks would be associated with dest_file. If the SPARQL buffer was flushed after the first task was created and before the second task was created, the second task would overwrite the first task in the ->priv->tasks hash table, so when the first task completed, the second task would be removed from the task pool without ever executing. This would mean that the URL of source_file never got updated to point at dest_file, which triggered the "Parent not indexed yet" error later on.
| * libtracker-miner/tracker-miner-fs.c: Rename item_move() parameterSam Thursfield2018-07-151-8/+8
| |
| * tests: Enable two more test cases in tracker-miner-fs-testSam Thursfield2018-07-151-2/+2
|/ | | | | Two of the test functions weren't being called, and two other test functions were being called twice. Oops.
* Merge branch 'sam/meson-test-fixes'Sam Thursfield2018-07-1512-188/+130
|\ | | | | | | See https://gitlab.gnome.org/GNOME/tracker/merge_requests/5
| * meson: Rework how unit tests are definedSam Thursfield2018-07-156-193/+125
| | | | | | | | | | | | | | | | Today I discovered that three testcases were being ignored in the Meson buildsystem, all due to mistakes. Now, the first thing in each meson.build file is the list of testcases so mistakes should be much easier to spot.
| * meson: Enable gb-737023 testSam Thursfield2018-07-151-1/+1
| |