diff options
author | Christopher Baines <mail@cbaines.net> | 2022-06-15 12:33:03 +0100 |
---|---|---|
committer | Christopher Baines <mail@cbaines.net> | 2022-06-15 12:33:03 +0100 |
commit | 7b12e9a29b9be0d74ce5da6bba38a394161c548f (patch) | |
tree | 99a9d487e2af9f042f45cc7ea37abe305fc70ecf /guix-build-coordinator | |
parent | d929581803e54aa62060beb0d05d13dac36c0d13 (diff) | |
download | build-coordinator-7b12e9a29b9be0d74ce5da6bba38a394161c548f.tar build-coordinator-7b12e9a29b9be0d74ce5da6bba38a394161c548f.tar.gz |
Fallback to reading derivations directly from substitute servers
Rather than doing this always, since it's not currently performant
enough. Once it's possible to read derivations in lazily, then this might be
feasible, but for now, just fall back to it if substituting times out, which
can happen if garbage collection is running.
Diffstat (limited to 'guix-build-coordinator')
-rw-r--r-- | guix-build-coordinator/client-communication.scm | 28 |
1 files changed, 19 insertions, 9 deletions
diff --git a/guix-build-coordinator/client-communication.scm b/guix-build-coordinator/client-communication.scm index e96b374..d121ca5 100644 --- a/guix-build-coordinator/client-communication.scm +++ b/guix-build-coordinator/client-communication.scm @@ -404,15 +404,25 @@ `(,build-coordinator ,derivation-file #:read-drv - ,(if (null? (or substitute-urls '())) - read-drv/substitute - (lambda (derivation-file) - (call-with-worker-thread - substitutes-channel - (lambda () - (read-derivation-through-substitutes - derivation-file - substitute-urls))))) + ,(lambda (derivation-file) + (with-timeout 30 + (begin + (log-msg (build-coordinator-logger build-coordinator) + 'WARN + "substituting derivation " derivation-file + " timed out") + + (if (null? (or substitute-urls '())) + ;; Try again + (read-drv/substitute derivation-file) + (call-with-worker-thread + substitutes-channel + (lambda () + (read-derivation-through-substitutes + derivation-file + substitute-urls))))) + + (read-drv/substitute derivation-file))) ,@(let ((priority (assoc-ref body "priority"))) (if priority `(#:priority ,priority) |