Attempt to avoid the WAL growing excessively

This commit is contained in:
Christopher Baines 2024-04-25 23:33:12 +01:00
parent 4a09be753c
commit 824e731a5c

View file

@ -1427,14 +1427,21 @@
guix-locpath))) guix-locpath)))
(ensure-non-blocking-store-connection inferior-store) (ensure-non-blocking-store-connection inferior-store)
(make-inferior-non-blocking! inferior) (make-inferior-non-blocking! inferior)
(simple-format #t "debug: started new inferior and store connection\n")
(cons inferior inferior-store))) (cons inferior inferior-store)))
parallelism parallelism
#:min-size 0 #:min-size 0
#:idle-seconds 10 #:idle-seconds 2
#:destructor (match-lambda #:destructor
((inferior . store) (match-lambda
(close-connection store) ((inferior . store)
(close-inferior inferior))))) (simple-format
#t "debug: closing inferior and associated store connection\n")
(close-connection store)
(close-inferior inferior)))))
(define add-temp-root/long-running-store (define add-temp-root/long-running-store
(let ((channel (make-channel))) (let ((channel (make-channel)))
@ -1477,6 +1484,14 @@
(par-map& (par-map&
(match-lambda (match-lambda
((system . target) ((system . target)
(let loop ((wal-bytes (stat:size (stat "/var/guix/db/db.sqlite-wal"))))
(when (> wal-bytes 200000000)
(simple-format #t "debug: guix-daemon WAL is large (~A), waiting\n"
wal-bytes)
(sleep 30)
(loop (stat:size (stat "/var/guix/db/db.sqlite-wal")))))
(with-resource-from-pool inf-and-store-pool res (with-resource-from-pool inf-and-store-pool res
(with-time-logging (with-time-logging
(simple-format #f "getting derivations for ~A" (cons system target)) (simple-format #f "getting derivations for ~A" (cons system target))