[tracker/wip/carlosg/test-error-fixes: 2/5] libtracker-data: Propagate error on queries executed while closing




commit 247cdd2215a3e6f9d039b8c22c1bb8f744ed0bd0
Author: Carlos Garnacho <carlosg gnome org>
Date:   Tue Jul 13 12:16:26 2021 +0200

    libtracker-data: Propagate error on queries executed while closing
    
    If the data manager is being closed, that will lead to crashes, propagate
    an error instead. Crash seen occasionally running tracker-miner-fs-test.

 src/libtracker-data/tracker-data-manager.c | 8 ++++++++
 1 file changed, 8 insertions(+)
---
diff --git a/src/libtracker-data/tracker-data-manager.c b/src/libtracker-data/tracker-data-manager.c
index 5edde0c4f..fce5b44cc 100644
--- a/src/libtracker-data/tracker-data-manager.c
+++ b/src/libtracker-data/tracker-data-manager.c
@@ -4560,6 +4560,14 @@ TrackerDBInterface *
 tracker_data_manager_get_db_interface (TrackerDataManager  *manager,
                                        GError             **error)
 {
+       if (!manager->db_manager) {
+               g_set_error (error,
+                            TRACKER_SPARQL_ERROR,
+                            TRACKER_SPARQL_ERROR_QUERY_FAILED,
+                            "Triple store is closing");
+               return NULL;
+       }
+
        return tracker_db_manager_get_db_interface (manager->db_manager, error);
 }
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]