From 39db021afdb48d0a08a3d8c17eff802af51fefbf Mon Sep 17 00:00:00 2001 From: Mathieu Othacehe Date: Wed, 30 Sep 2020 11:56:04 +0200 Subject: 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. --- bin/cuirass.in | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'bin') 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 -- cgit v1.2.3