Check the WAL size before computing lint warnings
As even though this might not use the store, the inferior still holds a store connection open.
This commit is contained in:
parent
05c3ae5b87
commit
c335775ed4
1 changed files with 24 additions and 22 deletions
|
|
@ -1824,6 +1824,22 @@ SELECT 1 FROM derivation_source_file_nars WHERE derivation_source_file_id = $1"
|
||||||
(with-resource-from-pool postgresql-connection-pool conn
|
(with-resource-from-pool postgresql-connection-pool conn
|
||||||
(insert-packages conn packages-data))))))
|
(insert-packages conn packages-data))))))
|
||||||
|
|
||||||
|
(define (check-wal-size)
|
||||||
|
(let loop ((wal-bytes
|
||||||
|
(catch #t
|
||||||
|
(lambda ()
|
||||||
|
(stat:size (stat "/var/guix/db/db.sqlite-wal")))
|
||||||
|
(lambda _ 0))))
|
||||||
|
(when (> wal-bytes (* 512 (expt 2 20)))
|
||||||
|
(simple-format #t "debug: guix-daemon WAL is large (~A), waiting\n"
|
||||||
|
wal-bytes)
|
||||||
|
|
||||||
|
(sleep 30)
|
||||||
|
(loop (catch #t
|
||||||
|
(lambda ()
|
||||||
|
(stat:size (stat "/var/guix/db/db.sqlite-wal")))
|
||||||
|
(lambda _ 0))))))
|
||||||
|
|
||||||
(define (extract-and-store-lint-checkers-and-warnings)
|
(define (extract-and-store-lint-checkers-and-warnings)
|
||||||
(define inferior-lint-checkers-data
|
(define inferior-lint-checkers-data
|
||||||
(with-resource-from-pool inf-and-store-pool res
|
(with-resource-from-pool inf-and-store-pool res
|
||||||
|
|
@ -1852,12 +1868,14 @@ SELECT 1 FROM derivation_source_file_nars WHERE derivation_source_file_id = $1"
|
||||||
;; Running the derivation linter is
|
;; Running the derivation linter is
|
||||||
;; currently infeasible
|
;; currently infeasible
|
||||||
(not (eq? checker-name 'derivation)))
|
(not (eq? checker-name 'derivation)))
|
||||||
(with-resource-from-pool inf-and-store-pool res
|
(begin
|
||||||
(match res
|
(check-wal-size)
|
||||||
((inferior . inferior-store)
|
(with-resource-from-pool inf-and-store-pool res
|
||||||
(inferior-lint-warnings inferior
|
(match res
|
||||||
inferior-store
|
((inferior . inferior-store)
|
||||||
checker-name)))))))
|
(inferior-lint-warnings inferior
|
||||||
|
inferior-store
|
||||||
|
checker-name))))))))
|
||||||
inferior-lint-checkers-data)))
|
inferior-lint-checkers-data)))
|
||||||
|
|
||||||
(let ((package-ids (fibers-force package-ids-promise)))
|
(let ((package-ids (fibers-force package-ids-promise)))
|
||||||
|
|
@ -1891,22 +1909,6 @@ SELECT 1 FROM derivation_source_file_nars WHERE derivation_source_file_id = $1"
|
||||||
|
|
||||||
(define chunk-size 3000)
|
(define chunk-size 3000)
|
||||||
|
|
||||||
(define (check-wal-size)
|
|
||||||
(let loop ((wal-bytes
|
|
||||||
(catch #t
|
|
||||||
(lambda ()
|
|
||||||
(stat:size (stat "/var/guix/db/db.sqlite-wal")))
|
|
||||||
(lambda _ 0))))
|
|
||||||
(when (> wal-bytes (* 512 (expt 2 20)))
|
|
||||||
(simple-format #t "debug: guix-daemon WAL is large (~A), waiting\n"
|
|
||||||
wal-bytes)
|
|
||||||
|
|
||||||
(sleep 30)
|
|
||||||
(loop (catch #t
|
|
||||||
(lambda ()
|
|
||||||
(stat:size (stat "/var/guix/db/db.sqlite-wal")))
|
|
||||||
(lambda _ 0))))))
|
|
||||||
|
|
||||||
(define (process-system-and-target system target)
|
(define (process-system-and-target system target)
|
||||||
(with-time-logging
|
(with-time-logging
|
||||||
(simple-format #f "processing derivations for ~A" (cons system target))
|
(simple-format #f "processing derivations for ~A" (cons system target))
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue