aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Baines <mail@cbaines.net>2024-03-05 10:57:41 +0000
committerChristopher Baines <mail@cbaines.net>2024-03-05 10:57:41 +0000
commitca69d3329d57c463aef76eddc32c3172becb5c56 (patch)
treef49e75f266e4a51bba5634dde484df90606512a4
parent20ad81f0d40bfd2f2e8d124dd58e8af2b5b00159 (diff)
downloaddata-service-ca69d3329d57c463aef76eddc32c3172becb5c56.tar
data-service-ca69d3329d57c463aef76eddc32c3172becb5c56.tar.gz
Add exception handling to the process-jobs script
As I'm seeing this exit on beid, but I'm not sure why.
-rw-r--r--scripts/guix-data-service-process-jobs.in32
1 files 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))))