aboutsummaryrefslogtreecommitdiff
path: root/guix-build-coordinator/agent.scm
diff options
context:
space:
mode:
Diffstat (limited to 'guix-build-coordinator/agent.scm')
-rw-r--r--guix-build-coordinator/agent.scm38
1 files changed, 25 insertions, 13 deletions
diff --git a/guix-build-coordinator/agent.scm b/guix-build-coordinator/agent.scm
index 0520da2..7afd549 100644
--- a/guix-build-coordinator/agent.scm
+++ b/guix-build-coordinator/agent.scm
@@ -46,7 +46,7 @@
#:use-module (guix base32)
#:use-module (guix serialization)
#:use-module ((guix build syscalls)
- #:select (set-thread-name))
+ #:select (set-thread-name free-disk-space))
#:use-module (guix-build-coordinator utils)
#:use-module (guix-build-coordinator agent-messaging)
#:use-module (guix-build-coordinator agent-messaging abstract)
@@ -77,7 +77,8 @@
derivation-substitute-urls
non-derivation-substitute-urls
metrics-file
- max-1min-load-average)
+ max-1min-load-average
+ timestamp-log-output?)
(define lgr (make <logger>))
(define port-log (make <port-log>
#:port (current-output-port)
@@ -85,9 +86,11 @@
;; In guile-lib v0.2.8 onwards, the formatter is
;; called with more arguments
(lambda args ; lvl, time, str
- (format #f "~a (~5a): ~a~%"
- (strftime "%F %H:%M:%S" (localtime
- (second args)))
+ (format #f "~a(~5a): ~a~%"
+ (if timestamp-log-output?
+ (strftime "%F %H:%M:%S " (localtime
+ (second args)))
+ "")
(first args)
(third args)))))
@@ -516,12 +519,21 @@
'())
(lambda ()
- (fetch-builds-for-agent
- coordinator-interface
- systems
- (+ (max current-threads 1)
- (count-post-build-jobs))
- #:log (build-log-procedure lgr)))
+ (let ((free-space (free-disk-space "/gnu/store")))
+ (if (< free-space (* 2 (expt 2 30))) ; 2G
+ (begin
+ (log-msg
+ lgr 'WARN
+ "low space on /gnu/store, "
+ "not fetching new builds")
+ (sleep 30)
+ '())
+ (fetch-builds-for-agent
+ coordinator-interface
+ systems
+ (+ (max current-threads 1)
+ (count-post-build-jobs))
+ #:log (build-log-procedure lgr)))))
#:unwind? #t))
(new-builds
(remove (lambda (build)
@@ -633,7 +645,7 @@ unable to query substitute servers without caching"))
(has-substiutes-no-cache?
non-derivation-substitute-urls
file))
- #:timeout (* 60 1000)))
+ #:timeout 60))
#:times 20
#:delay (random 15))
#f)))
@@ -695,7 +707,7 @@ but the guix-daemon claims it's unavailable"
((current-build-output-port log-port))
(build-things fetch-substitute-store
missing-paths)))
- #:timeout (* 60 10 1000)))
+ #:timeout (* 60 10)))
(lambda (key . args)
(log-msg lgr 'ERROR
"exception when fetching missing paths "