aboutsummaryrefslogtreecommitdiff
path: root/guix-build-coordinator
diff options
context:
space:
mode:
authorChristopher Baines <mail@cbaines.net>2024-05-15 18:39:17 +0100
committerChristopher Baines <mail@cbaines.net>2024-05-15 18:39:17 +0100
commitfff0017c42ceb01dd1f53f8e514bab969579b642 (patch)
tree738e053e7cf16b7a40e9bc46aec8dc503d4268db /guix-build-coordinator
parent1d6fc7b75163e564ff2708662e9d6e75d899b379 (diff)
downloadbuild-coordinator-fff0017c42ceb01dd1f53f8e514bab969579b642.tar
build-coordinator-fff0017c42ceb01dd1f53f8e514bab969579b642.tar.gz
Use threads for reading derivations
As it is quite slow on bayfront at least.
Diffstat (limited to 'guix-build-coordinator')
-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 091c821..34b05c9 100644
--- a/guix-build-coordinator/coordinator.scm
+++ b/guix-build-coordinator/coordinator.scm
@@ -628,12 +628,19 @@
(derivation
(if derivation-exists-in-database?
#f ; unnecessary to fetch derivation
- (with-fibers-port-timeouts
- (lambda ()
- (call-with-delay-logging read-drv
- #:threshold 10
- #:args (list derivation-file)))
- #:timeout 240)))
+ ;; 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 240))
+ #:readonly? #t)))
(system
(or system-from-database