aboutsummaryrefslogtreecommitdiff
path: root/guix-build-coordinator/client-communication.scm
diff options
context:
space:
mode:
authorChristopher Baines <mail@cbaines.net>2024-06-23 09:28:57 +0100
committerChristopher Baines <mail@cbaines.net>2024-06-25 13:19:12 +0100
commit84cafd6f4333c8bc8f43634cd34050e07b6f882f (patch)
treedad44b7d4de24bff063d4a49a8eaa7333dd05721 /guix-build-coordinator/client-communication.scm
parent7f3e0949c43f464b7562c77364a14d7b5dfd0c4a (diff)
downloadbuild-coordinator-84cafd6f4333c8bc8f43634cd34050e07b6f882f.tar
build-coordinator-84cafd6f4333c8bc8f43634cd34050e07b6f882f.tar.gz
Add a utility thread pool
And use this to read derivations.
Diffstat (limited to 'guix-build-coordinator/client-communication.scm')
-rw-r--r--guix-build-coordinator/client-communication.scm15
1 files changed, 11 insertions, 4 deletions
diff --git a/guix-build-coordinator/client-communication.scm b/guix-build-coordinator/client-communication.scm
index 3d780c4..354cb31 100644
--- a/guix-build-coordinator/client-communication.scm
+++ b/guix-build-coordinator/client-communication.scm
@@ -65,7 +65,8 @@
(define (start-client-request-server secret-key-base
host
port
- build-coordinator)
+ build-coordinator
+ utility-thread-pool-channel)
(run-server/patched
(lambda (request body)
(log-msg (build-coordinator-logger build-coordinator)
@@ -80,7 +81,8 @@
(uri-path (request-uri request))))
body
secret-key-base
- build-coordinator)))
+ build-coordinator
+ utility-thread-pool-channel)))
#:host host
#:port port))
@@ -88,7 +90,8 @@
method-and-path-components
raw-body
secret-key-base
- build-coordinator)
+ build-coordinator
+ utility-thread-pool-channel)
(define datastore
(build-coordinator-datastore build-coordinator))
@@ -483,7 +486,11 @@
(substitute-derivation store
derivation-file
#:substitute-urls substitute-urls)))
- (read-derivation-from-file* derivation-file))
+ ;; Read the derivation in a thread to avoid blocking fibers
+ (call-with-worker-thread
+ utility-thread-pool-channel
+ (lambda ()
+ (read-derivation-from-file* derivation-file))))
(let ((submit-build-result
(call-with-delay-logging