diff options
author | Mathieu Othacehe <othacehe@gnu.org> | 2020-09-30 11:56:04 +0200 |
---|---|---|
committer | Mathieu Othacehe <othacehe@gnu.org> | 2020-10-01 18:33:13 +0200 |
commit | 39db021afdb48d0a08a3d8c17eff802af51fefbf (patch) | |
tree | c704f816e47414a9393d0fdf371e38aaa3aabc45 /bin | |
parent | ce624ea72016d8e41a09798f91570fbf8ee74433 (diff) | |
download | cuirass-39db021afdb48d0a08a3d8c17eff802af51fefbf.tar cuirass-39db021afdb48d0a08a3d8c17eff802af51fefbf.tar.gz |
Add evaluation database workers.
Evaluation registration involves running a large number of SQL queries. This
can cause some database worker starvation as well as some contention. To avoid
this issue, spawn database workers dedicated to evaluation registration.
* src/cuirass/database.scm (%db-registration-channel): New variable.
(with-db-registration-worker-thread, with-registration-workers): New macros.
(with-db-worker-thread-no-timeout): Remove it.
(db-register-builds): Run registration in dedicated database workers using
"with-db-registration-worker-thread" macro.
* bin/cuirass.in (main): Spawn database registration workers by calling
"with-registration-workers" macro.
Diffstat (limited to 'bin')
-rw-r--r-- | bin/cuirass.in | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/bin/cuirass.in b/bin/cuirass.in index 55e92b6..8da9369 100644 --- a/bin/cuirass.in +++ b/bin/cuirass.in @@ -194,11 +194,12 @@ exec ${GUILE:-@GUILE@} --no-auto-compile -e main -s "$0" "$@" (essential-task 'build exit-channel (lambda () - (while #t - (process-specs (db-get-specifications)) - (log-message - "next evaluation in ~a seconds" interval) - (sleep interval))))) + (with-registration-workers + (while #t + (process-specs (db-get-specifications)) + (log-message + "next evaluation in ~a seconds" interval) + (sleep interval)))))) (spawn-fiber (essential-task |