From ca69d3329d57c463aef76eddc32c3172becb5c56 Mon Sep 17 00:00:00 2001 From: Christopher Baines Date: Tue, 5 Mar 2024 10:57:41 +0000 Subject: Add exception handling to the process-jobs script As I'm seeing this exit on beid, but I'm not sure why. --- scripts/guix-data-service-process-jobs.in | 32 ++++++++++++++++++++++--------- 1 file changed, 23 insertions(+), 9 deletions(-) (limited to 'scripts') diff --git a/scripts/guix-data-service-process-jobs.in b/scripts/guix-data-service-process-jobs.in index da4f614..ae1542c 100644 --- a/scripts/guix-data-service-process-jobs.in +++ b/scripts/guix-data-service-process-jobs.in @@ -77,12 +77,26 @@ "process-jobs" (lambda (conn) (simple-format #t "Ready to process jobs...\n") - (process-jobs conn - #:max-processes (assq-ref opts 'max-processes) - #:latest-branch-revision-max-processes - (or (assq-ref opts 'latest-branch-revision-max-processes) - (* 2 (assq-ref opts 'max-processes))) - #:skip-system-tests? - (assq-ref opts 'skip-system-tests) - #:per-job-parallelism - (assq-ref opts 'per-job-parallelism))))) + (with-exception-handler + (lambda (exn) + (simple-format + (current-error-port) + "exception: ~A\n" + exn) + (exit 1)) + (lambda () + (with-throw-handler #t + (lambda () + (process-jobs + conn + #:max-processes (assq-ref opts 'max-processes) + #:latest-branch-revision-max-processes + (or (assq-ref opts 'latest-branch-revision-max-processes) + (* 2 (assq-ref opts 'max-processes))) + #:skip-system-tests? + (assq-ref opts 'skip-system-tests) + #:per-job-parallelism + (assq-ref opts 'per-job-parallelism))) + (lambda _ + (backtrace)))) + #:unwind? #t)))) -- cgit v1.2.3