offload: Allow one transfer in each direction simultaneously.
* guix/scripts/offload.scm (transfer-and-offload): Use 'upload' lock instead of 'bandwidth' around 'send-files' calls, and 'download' lock around 'retrieve-files' call.
This commit is contained in:
parent
3dfd8af534
commit
236e66481d
|
@ -324,10 +324,10 @@ (define* (transfer-and-offload drv machine
|
||||||
"Offload DRV to MACHINE. Prior to the actual offloading, transfer all of
|
"Offload DRV to MACHINE. Prior to the actual offloading, transfer all of
|
||||||
INPUTS to MACHINE; if building DRV succeeds, retrieve all of OUTPUTS from
|
INPUTS to MACHINE; if building DRV succeeds, retrieve all of OUTPUTS from
|
||||||
MACHINE."
|
MACHINE."
|
||||||
;; Acquire MACHINE's exclusive lock to serialize file transfers
|
;; Acquire MACHINE's upload or download lock to serialize file transfers in
|
||||||
;; to/from MACHINE in the presence of several 'offload' hook
|
;; a given direction to/from MACHINE in the presence of several 'offload'
|
||||||
;; instance.
|
;; hook instance.
|
||||||
(when (with-machine-lock machine 'bandwidth
|
(when (with-machine-lock machine 'upload
|
||||||
(send-files (cons (derivation-file-name drv) inputs)
|
(send-files (cons (derivation-file-name drv) inputs)
|
||||||
machine))
|
machine))
|
||||||
(let ((status (offload drv machine
|
(let ((status (offload drv machine
|
||||||
|
@ -337,7 +337,7 @@ (define* (transfer-and-offload drv machine
|
||||||
(if (zero? status)
|
(if (zero? status)
|
||||||
(begin
|
(begin
|
||||||
;; Likewise (see above.)
|
;; Likewise (see above.)
|
||||||
(with-machine-lock machine 'bandwidth
|
(with-machine-lock machine 'download
|
||||||
(retrieve-files outputs machine))
|
(retrieve-files outputs machine))
|
||||||
(format (current-error-port)
|
(format (current-error-port)
|
||||||
"done with offloaded '~a'~%"
|
"done with offloaded '~a'~%"
|
||||||
|
|
Loading…
Reference in a new issue