guix-commits
[Top][All Lists]
Advanced

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

[no subject]


From: Ludovic Courtès
Date: Fri, 31 May 2024 04:11:59 -0400 (EDT)

branch: main
commit c2061ca845d05694ebeb88935a6ff2254711beb2
Author: Ludovic Courtès <ludo@gnu.org>
AuthorDate: Fri May 31 09:05:02 2024 +0200

    database: ‘db-remove-unresponsive-workers’ logs restarted builds.
    
    * src/cuirass/database.scm (db-remove-unresponsive-workers): Log the
    number of restarted builds.
---
 src/cuirass/database.scm | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/src/cuirass/database.scm b/src/cuirass/database.scm
index fb23ff3..26d1f18 100644
--- a/src/cuirass/database.scm
+++ b/src/cuirass/database.scm
@@ -2192,13 +2192,16 @@ Builds.starttime DESC, Builds.id DESC;"))
 Also restart the builds that are started on those workers."
   (with-db-connection db
     ;; Restart the builds that are marked as started on those workers.
-    (exec-query/bind db "
+    (let ((restarted (exec-query/bind db "
 UPDATE Builds SET status = -2, worker = null FROM
 (SELECT id FROM Workers LEFT JOIN Builds
 ON builds.worker = workers.name
 WHERE status = -1 AND
 (extract(epoch from now())::int - last_seen) > " timeout
-") AS expired WHERE builds.id = expired.id")
+") AS expired WHERE builds.id = expired.id")))
+      (unless (zero? restarted)
+        (log-info "restarted ~a builds that were on unresponsive workers"
+                  restarted)))
     (exec-query/bind db "DELETE FROM Workers WHERE
 (extract(epoch from now())::int - last_seen) > " timeout ";")))
 



reply via email to

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