aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Baines <mail@cbaines.net>2020-05-19 18:54:43 +0100
committerChristopher Baines <mail@cbaines.net>2020-05-19 18:54:43 +0100
commit4d308729c83869566ea07b7aae03f2cdef405cf1 (patch)
tree1febdec168a10306353db1acad4ee29f888c09d5
parentd5d30b17f678f6b0f7de45ba4fee2a5090b0ee8f (diff)
downloadbuild-coordinator-4d308729c83869566ea07b7aae03f2cdef405cf1.tar
build-coordinator-4d308729c83869566ea07b7aae03f2cdef405cf1.tar.gz
Fetch substitutes in a separate channel
As I'm guessing this could block the thread for fibers.
-rw-r--r--guix-build-coordinator/client-communication.scm20
-rw-r--r--scripts/guix-build-coordinator.in15
2 files changed, 23 insertions, 12 deletions
diff --git a/guix-build-coordinator/client-communication.scm b/guix-build-coordinator/client-communication.scm
index ae4a8c5..6f5e38c 100644
--- a/guix-build-coordinator/client-communication.scm
+++ b/guix-build-coordinator/client-communication.scm
@@ -47,7 +47,8 @@
(define (start-client-request-server secret-key-base
host
port
- build-coordinator)
+ build-coordinator
+ substitutes-channel)
(call-with-error-handling
(lambda ()
(run-server
@@ -63,7 +64,8 @@
(uri-path (request-uri request))))
body
secret-key-base
- build-coordinator)))
+ build-coordinator
+ substitutes-channel)))
#:host host
#:port port))
#:on-error 'backtrace))
@@ -72,7 +74,8 @@
method-and-path-components
raw-body
secret-key-base
- build-coordinator)
+ build-coordinator
+ substitutes-channel)
(define datastore
(build-coordinator-datastore build-coordinator))
@@ -158,10 +161,13 @@
(datastore-find-derivation datastore derivation-file)))
(unless derivation-database-entry
(unless (file-exists? derivation-file)
- (substitute-derivation derivation-file
- #:substitute-urls
- (vector->list
- (assoc-ref body "substitute-urls"))))
+ (call-with-worker-thread
+ substitutes-channel
+ (lambda ()
+ (substitute-derivation derivation-file
+ #:substitute-urls
+ (vector->list
+ (assoc-ref body "substitute-urls"))))))
(datastore-store-derivation
datastore
(read-derivation-from-file derivation-file))))
diff --git a/scripts/guix-build-coordinator.in b/scripts/guix-build-coordinator.in
index 0043a7e..77ab46e 100644
--- a/scripts/guix-build-coordinator.in
+++ b/scripts/guix-build-coordinator.in
@@ -463,12 +463,17 @@ processed?: ~A
chunked-request-channel)))))))
(client-communication-thunk
(let ((client-communication-uri
- (string->uri (assq-ref opts 'client-communication))))
+ (string->uri (assq-ref opts 'client-communication)))
+ (substitutes-channel
+ (make-worker-thread-channel (const '())
+ #:parallelism 2)))
(lambda ()
- (start-client-request-server (assq-ref opts 'secret-key-base)
- (uri-host client-communication-uri)
- (uri-port client-communication-uri)
- build-coordinator)))))
+ (start-client-request-server
+ (assq-ref opts 'secret-key-base)
+ (uri-host client-communication-uri)
+ (uri-port client-communication-uri)
+ build-coordinator
+ substitutes-channel)))))
(start-hook-processing-thread build-coordinator)
(trigger-build-allocation build-coordinator)