From 6102553d947c8ae2f321091916986b091b94cee0 Mon Sep 17 00:00:00 2001 From: Christopher Baines Date: Wed, 12 Jan 2022 18:17:35 +0000 Subject: [PATCH] Record job failure on non-0 exit status This is helpful when the jobs fail through Guile running out of memory for example. --- guix-data-service/jobs.scm | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/guix-data-service/jobs.scm b/guix-data-service/jobs.scm index 25db704..de8e456 100644 --- a/guix-data-service/jobs.scm +++ b/guix-data-service/jobs.scm @@ -103,10 +103,15 @@ ;; No process to wait for #f) ((pid . status) + (match (hash-ref processes pid) + ((_ (id)) + (simple-format (current-error-port) + "pid ~A (job: ~A) failed with status ~A\n" + pid id status) + + (handle-job-failure id))) + (hashv-remove! processes pid) - (simple-format (current-error-port) - "pid ~A failed with status ~A\n" - pid status) ;; Recurse, to check for other finished processes. (wait-on-processes))))