aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Baines <mail@cbaines.net>2024-06-06 09:27:05 +0100
committerChristopher Baines <mail@cbaines.net>2024-06-06 09:27:05 +0100
commit0b54c590d72f3b27fbb79af39c28f1b0592e65b2 (patch)
tree182861c46c8b9c7911acf28459dcce0d119857f3
parent7aa1369d6d5a34300045596cdf0bcfd6f4992f9b (diff)
downloadbuild-coordinator-0b54c590d72f3b27fbb79af39c28f1b0592e65b2.tar
build-coordinator-0b54c590d72f3b27fbb79af39c28f1b0592e65b2.tar.gz
Always use a thread to read derivations
-rw-r--r--guix-build-coordinator/coordinator.scm19
1 files changed, 13 insertions, 6 deletions
diff --git a/guix-build-coordinator/coordinator.scm b/guix-build-coordinator/coordinator.scm
index 34b05c9..63f9eaf 100644
--- a/guix-build-coordinator/coordinator.scm
+++ b/guix-build-coordinator/coordinator.scm
@@ -759,12 +759,19 @@
(unless (datastore-find-derivation datastore derivation-file)
(datastore-store-derivation
datastore
- (with-fibers-port-timeouts
- (lambda ()
- (call-with-delay-logging read-drv
- #:threshold 10
- #:args (list derivation-file)))
- #:timeout 30)))
+ ;; Bit of a hack, but offload reading the derivation to a thread so
+ ;; that it doesn't block the fibers thread, since local I/O doesn't
+ ;; cooperate with fibers
+ (datastore-call-with-transaction
+ datastore
+ (lambda _
+ (with-fibers-port-timeouts
+ (lambda ()
+ (call-with-delay-logging read-drv
+ #:threshold 10
+ #:args (list derivation-file)))
+ #:timeout 30))
+ #:readonly? #t)))
(let ((related-derivations-lacking-builds
(if ensure-all-related-derivation-outputs-have-builds?