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.
This commit is contained in:
parent
6af72c706c
commit
b296eb030e
1 changed files with 12 additions and 1 deletions
|
|
@ -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 --------------------------------------------------
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue