From 5727703d84f7c09b955e1c710cc9c5301f0e3208 Mon Sep 17 00:00:00 2001 From: Christopher Baines Date: Fri, 13 May 2022 12:03:43 +0100 Subject: [PATCH] Clear cached store connections when fetching lint warnings As I'm seeing the inferior process crash with [1] just after fetching the derivation lint warnings. This change appears to help, although it's probably just a workaround. When there's more packages/derivations, the caches might need clearing while fetching the derivation lint warnings, or this will need to be split across multiple processes. 1: Too many heap sections: Increase MAXHINCR or MAX_HEAP_SECTS --- .../jobs/load-new-guix-revision.scm | 19 +++++++++++++++++-- 1 file changed, 17 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 e499a8b..7f00c22 100644 --- a/guix-data-service/jobs/load-new-guix-revision.scm +++ b/guix-data-service/jobs/load-new-guix-revision.scm @@ -561,8 +561,23 @@ WHERE job_id = $1") '() (with-time-logging (simple-format #f "getting ~A lint warnings" name) - (inferior-eval-with-store inf store (lint-warnings-for-checker - name))))))) + (format (current-error-port) + "inferior heap size: ~a MiB~%" + (round + (/ (inferior-eval '(assoc-ref (gc-stats) 'heap-size) inf) + (expt 2. 20)))) + + (let ((warnings + (inferior-eval-with-store + inf + store + (lint-warnings-for-checker name)))) + + ;; Clean the cached store connections, as there are caches + ;; associated with these that take up lots of memory + (inferior-eval '(hash-clear! %store-table) inf) + + warnings)))))) checkers)))) (define (all-inferior-package-derivations store inf packages)