guix-commits
[Top][All Lists]
Advanced

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

01/02: Record job failure on non-0 exit status


From: Christopher Baines
Subject: 01/02: Record job failure on non-0 exit status
Date: Wed, 12 Jan 2022 19:22:52 -0500 (EST)

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

commit 6102553d947c8ae2f321091916986b091b94cee0
Author: Christopher Baines <mail@cbaines.net>
AuthorDate: Wed Jan 12 18:17:35 2022 +0000

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



reply via email to

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