fix(fleet): worker_hello periodisch wiederholen (wie Satellit) — Box wird nach Diagnostic/Bridge-Neustart wieder sichtbar
Worker sendeten worker_hello nur EINMAL beim Connect. Startet das Diagnostic oder die Bridge NACH der Box neu, verpassen sie das hello (RVS spielt es nicht nach) und sehen nur noch worker_ping → die Box taucht nicht in der Compute- Flotte auf. Der Satellit ist genau deshalb zuverlaessig sichtbar: er wiederholt sat_hello periodisch. - alle vier Worker (f5tts/whisper/voxtral/llm-adapter): worker_hello wird jetzt zusaetzlich alle ~30s (jeder 3. Ping-Zyklus) wiederholt → ein neu gestartetes Diagnostic/Bridge lernt die Box innerhalb von 30s, ohne Box-Neustart. - diagnostic/server.js: Voice-Reconcile (f5tts) laeuft nur beim ERSTEN/erneuten Auftauchen der Box, nicht bei jedem 30s-hello-Resend (sonst Push/Pull-Dauerlauf). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
+12
-6
@@ -842,17 +842,23 @@ async def _broadcast_status(ws, state: str, **extra) -> None:
|
||||
|
||||
async def _worker_register(ws, *, model: str = "", busy_fn=None) -> None:
|
||||
"""Meldet diesen Worker bei der aria-bridge an (worker_hello) und haelt die
|
||||
Flotten-Registry per periodischem worker_ping (mit busy-Status) frisch."""
|
||||
Flotten-Registry per periodischem worker_ping frisch. worker_hello wird
|
||||
zusaetzlich alle ~30s WIEDERHOLT (wie der Satellit sat_hello), damit auch ein
|
||||
neu gestartetes Diagnostic/Bridge uns lernt — RVS spielt hellos nicht nach."""
|
||||
def _hello():
|
||||
return {"instanceId": INSTANCE_ID, "service": WORKER_SERVICE,
|
||||
"node": NODE_NAME, "gpus": GPU_IDS, "model": model,
|
||||
"voices": _local_voice_names()}
|
||||
try:
|
||||
await _send(ws, "worker_hello", {
|
||||
"instanceId": INSTANCE_ID, "service": WORKER_SERVICE,
|
||||
"node": NODE_NAME, "gpus": GPU_IDS, "model": model,
|
||||
"voices": _local_voice_names(), # fuer Voice-Provisioning-Reconciliation
|
||||
})
|
||||
await _send(ws, "worker_hello", _hello())
|
||||
n = 0
|
||||
while True:
|
||||
await asyncio.sleep(WORKER_PING_INTERVAL_S)
|
||||
n += 1
|
||||
busy = bool(busy_fn()) if busy_fn else False
|
||||
await _send(ws, "worker_ping", {"instanceId": INSTANCE_ID, "busy": busy})
|
||||
if n % 3 == 0:
|
||||
await _send(ws, "worker_hello", _hello())
|
||||
except asyncio.CancelledError:
|
||||
raise
|
||||
except Exception:
|
||||
|
||||
@@ -260,10 +260,14 @@ async def _worker_register(ws) -> None:
|
||||
Flotten-Registry per periodischem worker_ping (mit busy-Status) frisch."""
|
||||
try:
|
||||
await _announce(ws)
|
||||
n = 0
|
||||
while True:
|
||||
await asyncio.sleep(WORKER_PING_INTERVAL_S)
|
||||
n += 1
|
||||
await _send(ws, "worker_ping",
|
||||
{"instanceId": INSTANCE_ID, "busy": _inflight > 0})
|
||||
if n % 3 == 0: # ~30s worker_hello wiederholen (wie der Satellit) →
|
||||
await _announce(ws) # auch neu gestartetes Diagnostic/Bridge lernt uns
|
||||
except asyncio.CancelledError:
|
||||
raise
|
||||
except Exception:
|
||||
|
||||
@@ -713,15 +713,19 @@ async def _broadcast_status(ws, state: str, **extra) -> None:
|
||||
async def _worker_register(ws, *, model: str = "", busy_fn=None) -> None:
|
||||
"""Meldet diesen Worker bei der aria-bridge an (worker_hello) und haelt die
|
||||
Flotten-Registry per periodischem worker_ping (mit busy-Status) frisch."""
|
||||
def _hello():
|
||||
return {"instanceId": INSTANCE_ID, "service": WORKER_SERVICE,
|
||||
"node": NODE_NAME, "gpus": GPU_IDS, "model": model}
|
||||
try:
|
||||
await _send(ws, "worker_hello", {
|
||||
"instanceId": INSTANCE_ID, "service": WORKER_SERVICE,
|
||||
"node": NODE_NAME, "gpus": GPU_IDS, "model": model,
|
||||
})
|
||||
await _send(ws, "worker_hello", _hello())
|
||||
n = 0
|
||||
while True:
|
||||
await asyncio.sleep(WORKER_PING_INTERVAL_S)
|
||||
n += 1
|
||||
busy = bool(busy_fn()) if busy_fn else False
|
||||
await _send(ws, "worker_ping", {"instanceId": INSTANCE_ID, "busy": busy})
|
||||
if n % 3 == 0: # ~30s worker_hello wiederholen (wie der Satellit)
|
||||
await _send(ws, "worker_hello", _hello())
|
||||
except asyncio.CancelledError:
|
||||
raise
|
||||
except Exception:
|
||||
|
||||
+11
-5
@@ -837,16 +837,22 @@ async def _broadcast_status(ws, state: str, **extra) -> None:
|
||||
|
||||
async def _worker_register(ws, *, model: str = "", busy_fn=None) -> None:
|
||||
"""Meldet diesen Worker bei der aria-bridge an (worker_hello) und haelt die
|
||||
Flotten-Registry per periodischem worker_ping (mit busy-Status) frisch."""
|
||||
Flotten-Registry per periodischem worker_ping frisch. worker_hello wird alle
|
||||
~30s WIEDERHOLT (wie der Satellit), damit ein neu gestartetes Diagnostic/
|
||||
Bridge uns lernt — RVS spielt hellos nicht nach."""
|
||||
def _hello():
|
||||
return {"instanceId": INSTANCE_ID, "service": WORKER_SERVICE,
|
||||
"node": NODE_NAME, "gpus": GPU_IDS, "model": model}
|
||||
try:
|
||||
await _send(ws, "worker_hello", {
|
||||
"instanceId": INSTANCE_ID, "service": WORKER_SERVICE,
|
||||
"node": NODE_NAME, "gpus": GPU_IDS, "model": model,
|
||||
})
|
||||
await _send(ws, "worker_hello", _hello())
|
||||
n = 0
|
||||
while True:
|
||||
await asyncio.sleep(WORKER_PING_INTERVAL_S)
|
||||
n += 1
|
||||
busy = bool(busy_fn()) if busy_fn else False
|
||||
await _send(ws, "worker_ping", {"instanceId": INSTANCE_ID, "busy": busy})
|
||||
if n % 3 == 0:
|
||||
await _send(ws, "worker_hello", _hello())
|
||||
except asyncio.CancelledError:
|
||||
raise
|
||||
except Exception:
|
||||
|
||||
Reference in New Issue
Block a user