summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* tests: Adapt TrackerFileNotifier tests to internal behavioral changewip/carlosg/direct-rewriteCarlos Garnacho2018-07-211-0/+2
| | | | | | | | | | Before commit 68381c1dd, ensure_parents() would stop before the indexing root in the assumption that it was already notified upon, that commit made it so those folders are ensured to be notified too. This internal behavioral change is normally evened out by TrackerMinerFS, but shows at the tests for the internal TrackerFileNotifier object as there is nothing there to set the IRI for those files.
* libtracker-miner: Coalesce 2 CREATED eventsCarlos Garnacho2018-07-211-1/+2
| | | | | | | | | It is not even clear this is possible in real life cases, however the standalone tracker-file-notifier tests fall into this (due to IRI not being ever set, still this is an async op). In the case of 2 consecutive CREATED events on the same file, it would be dealt with in TrackerMinerFS as CREATED+ UPDATED. This was already harmless, but we can do better and swallow one of such events.
* libtracker-direct: Use specific includeCarlos Garnacho2018-07-201-1/+1
| | | | | | This is an internal header, so we don't need pointing to the general tracker-data.h header. Fixes build from scratch on meson as some files pulled from there are unexpectedly in the build directory.
* libtracker-direct: Avoid WAL checkpoint on readonly connectionsCarlos Garnacho2018-07-201-2/+7
| | | | | There is no point in doing WAL checkpoints from a readonly connection, so avoid it altogether.
* libtracker-data: Fetch shared connection on failure to create oneCarlos Garnacho2018-07-201-8/+15
| | | | | | | | | | | | On stress situations (tests/functional-tests/ipc/test-bus-query-cancellation is known to trigger this) there may be too many opened FDs all around (dbus related, fds passed for resultsets, DB connections, ...) to keep it all together. In those cases, we may attempt to create an extra interface to cater for the incoming request, but it will just fail underneath us. In those cases it is preferrable to fetch a connection from the pool and have it shared across threads than tripping into critical warnings and undefined behavior.
* Update meson build system for libtracker-direct changesSam Thursfield2018-07-203-14/+5
|
* libtracker-direct: Remove unused variablesSam Thursfield2018-07-201-2/+1
|
* tracker-store: Use TrackerDirectConnection underneathCarlos Garnacho2018-07-205-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-204-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-205-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-201-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-201-21/+24
| | | | Purely cosmetic.
* tracker-store: Give ownership of writeback events on get_ready()Carlos Garnacho2018-07-203-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-204-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-201-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-208-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-205-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-203-12/+52
| | | | This will flush all updates and trigger the WAL hook.
* libtracker-direct: Add internal function to set additional DBManager flagsCarlos Garnacho2018-07-203-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-203-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-204-27/+1
|
* libtracker-direct: Add internal TrackerDataManager getterCarlos Garnacho2018-07-203-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-207-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/notifier-race-fix'Sam Thursfield2018-07-201-2/+6
|\ | | | | | | See https://gitlab.gnome.org/GNOME/tracker/merge_requests/9
| * libtracker-miner: Fix race which resulted in files being queued out of orderSam Thursfield2018-07-201-2/+6
|/ | | | | | | | | | | | | | | | | | | | | | | The TrackerFileNotifier signals need to be emitted in a heirarchical order. If we have this directory heirarchy... test-monitored/ test-monitored/file1.txt ...we must always emit ::file-created for 'test-monitored/' before we emit ::file-created for 'test-monitored/file1.txt'. The tracker_file_notifier_ensure_parents() function ensures that we do this, but it would previously not work correctly in situations where 'test-monitored/' was a configured indexing root, rather than a subdirectory of one of the roots. This was causing the tracker-miners functional tests to randomly fail with errors such as this: ** (tracker-miner-fs:18181): WARNING **: 16:01:00.461: Parent 'file:///home/sam/tracker-tests/tmpDSmsQI/test-monitored' not indexed yet This is presumably a regression from 2e2dd4f5dc650aefa4b7188cf1a612b2d27f84ba.
* Update Italian translationMilo Casagrande2018-07-191-69/+67
|
* Update Swedish translationAnders Jonsson2018-07-181-69/+67
|
* meson: Consolite vars used for running tracker-store uninstalledSam Thursfield2018-07-175-12/+13
| | | | | | | | | | | | Most importantly, these are consumed in the tracker-miners.git project so that it can run when built with tracker core as a Meson subproject. This should theoretically allow building tracker-miners on systems that don't have tracker installed at all, although I think some problems remain with doing that. Note that meson.source_root() must never be used in variables that are consumed by a subproject, because in that situation they expand to the root of the *toplevel project* and not the current subproject.
* Update German translationFlorian Heiser2018-07-161-619/+492
|
* Update Brazilian Portuguese translationBruno Lopes da Silva2018-07-161-496/+515
|
* 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
|