Limit the parallelism when running derivation-file-names->derivation-ids

To focus on finishing some systems before starting the next.
This commit is contained in:
Christopher Baines 2025-07-06 15:01:03 +01:00
parent 02947cc9c4
commit 0184f10942

View file

@ -2631,21 +2631,25 @@ WHERE builder != 'builtin:download'
(loop (+ start-index chunk-size)))))) (loop (+ start-index chunk-size))))))
derivations-vector))) derivations-vector)))
(define derivation-file-names->derivation-ids/parallelism-limiter
(make-parallelism-limiter 2))
(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))
(let* ((derivations-vector (get-derivations system target)) (let* ((derivations-vector (get-derivations system target))
(derivation-ids (derivation-ids
(with-time-logging (with-parallelism-limiter
(simple-format #f "derivation-file-names->derivation-ids (~A ~A)" derivation-file-names->derivation-ids/parallelism-limiter
system target) (with-time-logging
(derivation-file-names->derivation-ids (simple-format #f "derivation-file-names->derivation-ids (~A ~A)"
postgresql-connection-pool system target)
call-with-utility-thread (derivation-file-names->derivation-ids
read-derivations/serialised postgresql-connection-pool
derivation-ids-hash-table call-with-utility-thread
derivations-vector read-derivations/serialised
#:log-tag (simple-format #f "~A:~A" system target)))) derivation-ids-hash-table
derivations-vector
#:log-tag (simple-format #f "~A:~A" system target)))))
(guix-revision-id (guix-revision-id
(fibers-force guix-revision-id-promise)) (fibers-force guix-revision-id-promise))
(package-ids (fibers-force package-ids-promise)) (package-ids (fibers-force package-ids-promise))