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: Tue, 10 Oct 2023 18:05:45 -0400 (EDT)

branch: master
commit 9d60a88b6341818568edefb57eb189d6e582ab28
Author: Ludovic Courtès <ludo@gnu.org>
AuthorDate: Tue Oct 10 12:00:13 2023 +0200

    base: Create an actor for inactive jobsets.
    
    Fixes a bug whereby inactive jobsets would not get a corresponding
    actors.  Consequently, marking them as “active” in the database and/or
    modifying their spec via the web UI wouldn’t have any effect.
    
    * src/cuirass/base.scm (jobset-monitor): Check whether SPEC is active,
    and if not, wait for an ‘update-spec’ message.
    (jobset-registry): Pass #:filter-inactive? #f.
---
 src/cuirass/base.scm | 35 ++++++++++++++++++++++-------------
 1 file changed, 22 insertions(+), 13 deletions(-)

diff --git a/src/cuirass/base.scm b/src/cuirass/base.scm
index 316e52e..50cb57e 100644
--- a/src/cuirass/base.scm
+++ b/src/cuirass/base.scm
@@ -765,21 +765,30 @@ concurrently; it sends derivation build requests to 
BUILDER."
                 (loop spec
                       (cons timestamp (take-while recent? last-updates)))))))
 
-      (if (null? last-updates)                    ;first time?
-          (perform-update)
-          (match (get-message* channel polling-period 'timeout)
-            ('timeout
-             (log-info "polling jobset '~a' after ~as timeout expiry"
-                       name polling-period)
-             (perform-update))
-            ('trigger
-             (log-info "triggered update of jobset '~a'" name)
-             (perform-update))
+      (if (specification-is-active? spec)
+          (if (null? last-updates)                ;first time?
+              (perform-update)
+              (match (get-message* channel polling-period 'timeout)
+                ('timeout
+                 (log-info "polling jobset '~a' after ~as timeout expiry"
+                           name polling-period)
+                 (perform-update))
+                ('trigger
+                 (log-info "triggered update of jobset '~a'" name)
+                 (perform-update))
+                (`(update-spec ,spec)
+                 (log-info "updating spec of jobset '~a'" name)
+                 (loop spec last-updates))
+                (message
+                 (log-warning "jobset '~a' got bogus message: ~s"
+                              name message)
+                 (loop spec last-updates))))
+          (match (get-message channel)            ;currently inactive
             (`(update-spec ,spec)
-             (log-info "updating spec of jobset '~a'" name)
+             (log-info "updating spec of inactive jobset '~a'" name)
              (loop spec last-updates))
             (message
-             (log-warning "jobset '~a' got bogus message: ~s"
+             (log-warning "inactive jobset '~a' got unexpected message: ~s"
                           name message)
              (loop spec last-updates)))))))
 
@@ -808,7 +817,7 @@ POLLING-PERIOD seconds."
   (lambda ()
     (spawn-fiber
      (lambda ()
-       (let ((specs (db-get-specifications)))
+       (let ((specs (db-get-specifications #:filter-inactive? #f)))
          (log-info "registering ~a jobsets" (length specs))
          (for-each (lambda (spec)
                      (register-jobset channel spec))



reply via email to

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