diff --git a/examples/cuda-fanout/gpu-worker.lsp b/examples/cuda-fanout/gpu-worker.lsp index e057101..2dfa5db 100644 --- a/examples/cuda-fanout/gpu-worker.lsp +++ b/examples/cuda-fanout/gpu-worker.lsp @@ -449,6 +449,16 @@ ((or (eq? line #f) (eof-object? line)) 0) (else (or (string->number (parse-trim line)) 0))))))))))) +(define (health-feeder-paused) + ;; 1 if $BEND_QUEUE_DIR/FEEDER_PAUSE marker present (operator wants + ;; this host out of the rotation; feeder should not push or restart + ;; supervisors here). 0 if no marker. -1 if BEND_QUEUE_DIR unset. + (let ((qdir (get-environment-variable "BEND_QUEUE_DIR"))) + (cond + ((or (eq? qdir #f) (string=? qdir "")) -1) + ((file-exists? (string-append qdir "/FEEDER_PAUSE")) 1) + (else 0)))) + (define (handle-health) (list 'ok (list 'load-avg (health-load-avg)) @@ -458,7 +468,8 @@ (list 'dispatcher-procs (health-dispatcher-procs)) (list 'queue-ready (health-queue-count "ready")) (list 'queue-emitting (health-queue-count "emitting")) - (list 'queue-done (health-queue-count "done")))) + (list 'queue-done (health-queue-count "done")) + (list 'feeder-paused (health-feeder-paused)))) ;;; -- dispatch --------------------------------------------------