diff options
author | Ludovic Courtès <ludo@gnu.org> | 2018-04-05 22:17:45 +0200 |
---|---|---|
committer | Ludovic Courtès <ludo@gnu.org> | 2018-04-05 22:25:02 +0200 |
commit | 074b9d02f1ca01007f39adbc019763027a51d9bd (patch) | |
tree | 35089c31d822d63bee736c55da128940bcfd50d7 /bin | |
parent | fc24ca2eac708695f663623a50f715db5ca914bd (diff) | |
download | cuirass-074b9d02f1ca01007f39adbc019763027a51d9bd.tar cuirass-074b9d02f1ca01007f39adbc019763027a51d9bd.tar.gz |
base: Let sqlite handle deduplication of the list of pending derivations.
Previously we would make a SQL query that would return many build jobs,
and then call 'delete-duplicates' on that. This was extremely wasteful
because the list of returned by the query was huge leading to a heap of
several tens of GiB on a big database, and 'delete-duplicates' would
lead to more GC and it would take ages.
Furthermore, since 'delete-duplicates' is written in C as of Guile
2.2.3, it is uninterruptible from Fiber's viewpoint. Consequently, the
kernel thread running the 'restart-builds' fiber would never schedule
other fibers, which could lead to deadlocks--e.g., since fibers are
scheduled on a circular shuffled list of kernel threads, once every N
times, a web server fiber would be sent to that kernel thread and not be
serviced.
* src/cuirass/base.scm (shuffle-jobs): Remove.
(shuffle-derivations): New procedure.
(spawn-builds): Take a list of derivations instead of a list of jobs.
(restart-builds): Remove 'builds' parameter. Remove 'delete-duplicates'
call. Remove done/remaining partitioning.
(build-packages): Adjust to pass 'spawn-builds' a list of derivations.
* bin/cuirass.in (main): Remove computation of PENDING. Remove second
parameter in call to 'restart-builds'.
Diffstat (limited to 'bin')
-rw-r--r-- | bin/cuirass.in | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/bin/cuirass.in b/bin/cuirass.in index fa0d6af..d27167c 100644 --- a/bin/cuirass.in +++ b/bin/cuirass.in @@ -128,12 +128,9 @@ exec ${GUILE:-@GUILE@} --no-auto-compile -e main -s "$0" "$@" new-specs))) (if one-shot? (process-specs db (db-get-specifications db)) - (let ((exit-channel (make-channel)) - (pending - (begin - (clear-build-queue db) - (log-message "retrieving list of pending builds...") - (db-get-builds db '((status pending)))))) + (let ((exit-channel (make-channel))) + + (clear-build-queue db) ;; First off, restart builds that had not completed or ;; were not even started on a previous run. @@ -142,7 +139,7 @@ exec ${GUILE:-@GUILE@} --no-auto-compile -e main -s "$0" "$@" 'restart-builds exit-channel (lambda () (with-database db - (restart-builds db pending))))) + (restart-builds db))))) (spawn-fiber (essential-task |