From b296eb030ee9dcacc4c881bf6794b98d818139e7 Mon Sep 17 00:00:00 2001 From: "russell@unturf.com" Date: Tue, 9 Jun 2026 15:15:06 -0400 Subject: [PATCH] gpu-worker: feeder-paused state in (health) RPC bend's (health) now reports whether $BEND_QUEUE_DIR/FEEDER_PAUSE marker is set. Consumers (feeder, factory-status, ops scripts) get pause state in the same single RPC as bend liveness + supervisor proc counts + queue depths. Returns: 1 marker present (operator wants this host out of rotation) 0 no marker (host in active rotation) -1 BEND_QUEUE_DIR env unset (host has no associated queue) Lets a future feeder version drop separate SSH pause-marker probes in favor of the bend health RPC. Today's feeder still does the SSH check; this just opens the door for the simpler model. --- examples/cuda-fanout/gpu-worker.lsp | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) 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 --------------------------------------------------