From d33618404721418d19da6694a2eefd81f64dccdb Mon Sep 17 00:00:00 2001 From: Carlos Garnacho Date: Sun, 9 Apr 2023 21:29:44 +0200 Subject: direct: Prune only content of correctly finished batches Commit 944988326 attempted made finished batches cheap to keep in memory, for languages where we don't have full control of object lifetime (e.g. GJS). This however broke tracker-miner-fs-3 handling of failures, since that tries to peek at TrackerResources that were already disposed by the TrackerBatch being cleared of content, in order to retry, or report for `tracker3 status`. In order to fix that and keep the improvement for the common case (i.e. success), only clear the TrackerBatch contents if the operation finished successfully. Fixes: 944988326 ("libtracker-sparql/direct: Prune content of already executed batches") --- src/libtracker-sparql/direct/tracker-direct-batch.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src') diff --git a/src/libtracker-sparql/direct/tracker-direct-batch.c b/src/libtracker-sparql/direct/tracker-direct-batch.c index 663d23dce..3f21eed11 100644 --- a/src/libtracker-sparql/direct/tracker-direct-batch.c +++ b/src/libtracker-sparql/direct/tracker-direct-batch.c @@ -310,8 +310,6 @@ tracker_direct_batch_update (TrackerDirectBatch *batch, break; } - g_array_set_size (priv->array, 0); - if (!inner_error) tracker_data_update_buffer_flush (data, &inner_error); @@ -324,6 +322,7 @@ tracker_direct_batch_update (TrackerDirectBatch *batch, if (inner_error) goto error; + g_array_set_size (priv->array, 0); g_hash_table_unref (bnodes); g_hash_table_unref (visited); -- cgit v1.2.1