From fd2a3ad6c1621abf63a686c42030c8a5daf5f9b2 Mon Sep 17 00:00:00 2001 From: Christopher Baines Date: Fri, 18 Apr 2025 11:01:44 +0100 Subject: [PATCH] Clear the derivation-ids-hash-table when holding the db connection --- guix-data-service/jobs/load-new-guix-revision.scm | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/guix-data-service/jobs/load-new-guix-revision.scm b/guix-data-service/jobs/load-new-guix-revision.scm index 716e186..5abe945 100644 --- a/guix-data-service/jobs/load-new-guix-revision.scm +++ b/guix-data-service/jobs/load-new-guix-revision.scm @@ -1265,8 +1265,11 @@ SELECT 1 FROM derivation_source_file_nars WHERE derivation_source_file_id = $1" (lambda () ;; If this has happened because derivations have been removed, it ;; might be necessary to insert them in the database where they - ;; previously existed - (hash-clear! derivation-ids-hash-table) + ;; previously existed. Clear the hash table while having the + ;; PostgreSQL connection to avoid issues with it being used at the + ;; same time. + (with-resource-from-pool postgresql-connection-pool conn + (hash-clear! derivation-ids-hash-table)) (insert-input-derivations derivations)))))) (define (fix-derivation file-name)