[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[no subject]
From: |
Mathieu Othacehe |
Date: |
Sun, 20 Nov 2022 12:32:59 -0500 (EST) |
branch: master
commit 553f107d373b739354ead60f4e220d5038b31e35
Author: Mathieu Othacehe <othacehe@gnu.org>
AuthorDate: Sun Nov 20 17:38:56 2022 +0100
Revert "remote-worker: Do not block on request-work response."
This reverts commit 1fb4b0ac1297e9bd680d0f4a356ce3050b27f913.
---
src/cuirass/remote.scm | 29 -----------------------------
src/cuirass/scripts/remote-worker.scm | 6 +-----
2 files changed, 1 insertion(+), 34 deletions(-)
diff --git a/src/cuirass/remote.scm b/src/cuirass/remote.scm
index a030da7..3513a81 100644
--- a/src/cuirass/remote.scm
+++ b/src/cuirass/remote.scm
@@ -69,7 +69,6 @@
receive-logs
send-log
- zmq-get-msg-parts-bytevector/no-wait
zmq-poll*
zmq-message-receive*
zmq-socket-ready?
@@ -383,34 +382,6 @@ retries a call to PROC."
safe)
-(define-syntax-rule (EAGAIN-safe proc ...)
- "Return a variant of PROC that catches EAGAIN 'zmq-error' exceptions."
- (catch 'zmq-error
- (lambda ()
- proc ...)
- (lambda (key errno . rest)
- (if (= errno EAGAIN)
- 'egain
- (apply throw key errno rest)))))
-
-(define* (zmq-get-msg-parts-bytevector/no-wait socket parts
- #:key
- (retries 10)
- (interval 1))
- "Call ZMQ-GET-MSG-PARTS-BYTEVECTOR but pass it the ZMQ_DONTWAIT flag. If
-there is nothing to be read on SOCKET and it returns EAGAIN, catch it and
-retry RETRIES times spaced by INTERVAL seconds. Return #false if nothing was
-read after retrying."
- (let loop ((retries retries))
- (and (> retries 0)
- (match (EAGAIN-safe
- (zmq-get-msg-parts-bytevector socket parts
- #:flags ZMQ_DONTWAIT))
- ('egain
- (sleep interval)
- (loop (- retries 1)))
- (x x)))))
-
(define zmq-poll*
;; Return a variant of ZMQ-POLL that catches EINTR errors.
(EINTR-safe zmq-poll))
diff --git a/src/cuirass/scripts/remote-worker.scm
b/src/cuirass/scripts/remote-worker.scm
index 639c878..af1eb2d 100644
--- a/src/cuirass/scripts/remote-worker.scm
+++ b/src/cuirass/scripts/remote-worker.scm
@@ -378,11 +378,7 @@ and executing them. The worker can reply on the same
socket."
(begin
(log-info (G_ "~a: request work.") (worker-name wrk))
(request-work socket worker)
- ;; Use a no-wait variant because the server could die
- ;; unexpectedly and we would be blocked on the receive call
- ;; forever.
- (match (zmq-get-msg-parts-bytevector/no-wait socket '())
- (#f #f) ;no response, keep going.
+ (match (zmq-get-msg-parts-bytevector socket '())
((empty command)
(run-command (bv->string command) server
#:reply (reply socket)