diff options
author | Christopher Baines <mail@cbaines.net> | 2024-05-14 13:04:02 +0100 |
---|---|---|
committer | Christopher Baines <mail@cbaines.net> | 2024-05-14 13:04:02 +0100 |
commit | dd07e8927cfd762c450d99ad0004700cbb098665 (patch) | |
tree | 687029ff8ed4156422dba004722b256ccef8d807 /guix-build-coordinator | |
parent | e5b48435163e60483b03e5f6f0e137fc9b8c2ae0 (diff) | |
download | build-coordinator-dd07e8927cfd762c450d99ad0004700cbb098665.tar build-coordinator-dd07e8927cfd762c450d99ad0004700cbb098665.tar.gz |
Use with-store/non-blocking from guix
As it opens a non-blocking connection, rather than doing a blocking handshake
then making the socket non-blocking.
Diffstat (limited to 'guix-build-coordinator')
-rw-r--r-- | guix-build-coordinator/client-communication.scm | 3 | ||||
-rw-r--r-- | guix-build-coordinator/utils.scm | 19 |
2 files changed, 1 insertions, 21 deletions
diff --git a/guix-build-coordinator/client-communication.scm b/guix-build-coordinator/client-communication.scm index 80d8c96..b3d8e55 100644 --- a/guix-build-coordinator/client-communication.scm +++ b/guix-build-coordinator/client-communication.scm @@ -461,8 +461,7 @@ derivation)))) (define (read-drv/substitute derivation-file) - (with-store store - (ensure-non-blocking-store-connection store) + (with-store/non-blocking store (unless (valid-path? store derivation-file) (substitute-derivation store derivation-file diff --git a/guix-build-coordinator/utils.scm b/guix-build-coordinator/utils.scm index c6c2d59..0acd62a 100644 --- a/guix-build-coordinator/utils.scm +++ b/guix-build-coordinator/utils.scm @@ -64,8 +64,6 @@ read-derivation-from-file* non-blocking-port - ensure-non-blocking-store-connection - with-store/non-blocking substitute-derivation read-derivation-through-substitutes @@ -395,23 +393,6 @@ (fcntl port F_SETFL (logior O_NONBLOCK flags))) port)) -(define (ensure-non-blocking-store-connection store) - "Mark the file descriptor that backs STORE, a <store-connection>, as -O_NONBLOCK." - (match (store-connection-socket store) - ((? file-port? port) - (non-blocking-port port)) - (_ #f))) - -(define-syntax-rule (with-store/non-blocking store exp ...) - "Like 'with-store', bind STORE to a connection to the store, but ensure that -said connection is non-blocking (O_NONBLOCK). Evaluate EXP... in that -context." - (with-store store - (ensure-non-blocking-store-connection store) - (let () - exp ...))) - (define* (substitute-derivation store derivation-name #:key substitute-urls) |