guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

04/06: Add exception handling to the process-jobs script


From: Christopher Baines
Subject: 04/06: Add exception handling to the process-jobs script
Date: Thu, 7 Mar 2024 05:08:38 -0500 (EST)

cbaines pushed a commit to branch master
in repository data-service.

commit ca69d3329d57c463aef76eddc32c3172becb5c56
Author: Christopher Baines <mail@cbaines.net>
AuthorDate: Tue Mar 5 10:57:41 2024 +0000

    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(-)

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))))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]