guix-commits
[Top][All Lists]
Advanced

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

branch master updated: Clear cached store connections when fetching lint


From: Christopher Baines
Subject: branch master updated: Clear cached store connections when fetching lint warnings
Date: Fri, 13 May 2022 07:05:40 -0400

This is an automated email from the git hooks/post-receive script.

cbaines pushed a commit to branch master
in repository data-service.

The following commit(s) were added to refs/heads/master by this push:
     new 5727703  Clear cached store connections when fetching lint warnings
5727703 is described below

commit 5727703d84f7c09b955e1c710cc9c5301f0e3208
Author: Christopher Baines <mail@cbaines.net>
AuthorDate: Fri May 13 12:03:43 2022 +0100

    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
---
 guix-data-service/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)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]