fix(m0): record an STT load without timings as a gap, not a pass
A worker that did not stop in time returned its earlier "loaded" note, was killed, and the placement still counted as ok with no transcription times. finish() now reports a timeout, and a worker that timed out, died, never started or measured no ten-speaker or single-clip timing is an error, so the stage is partial and the next run retries it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -295,7 +295,8 @@ class SttLoad:
|
||||
try:
|
||||
self.proc.wait(timeout=timeout)
|
||||
except subprocess.TimeoutExpired:
|
||||
pass
|
||||
# Whatever the file holds is the "loaded" note, not timings; close() kills the worker.
|
||||
return {"status": "timeout", "errors": [f"stt worker did not stop within {timeout:.0f} s"]}
|
||||
return self._read()
|
||||
|
||||
def close(self) -> None:
|
||||
@@ -306,6 +307,20 @@ class SttLoad:
|
||||
self._logf.close()
|
||||
|
||||
|
||||
def stt_gaps(busy: dict) -> list[str]:
|
||||
"""Why an STT load next to the LLM did not measure what it should: its errors, a worker that
|
||||
did not finish (timed out, died, never started), or no ten-speaker or single-clip timings."""
|
||||
gaps = list(busy.get("errors") or [])
|
||||
if busy.get("status") != "done":
|
||||
if not gaps:
|
||||
gaps.append(f"stt worker ended as {busy.get('status') or 'nothing written'}")
|
||||
return gaps
|
||||
for key in ("batch10_s", "single_s"):
|
||||
if not (busy.get(key) or {}).get("n"):
|
||||
gaps.append(f"stt worker measured no {key}")
|
||||
return gaps
|
||||
|
||||
|
||||
def port_in_use(port: int) -> bool:
|
||||
with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as sock:
|
||||
sock.settimeout(2)
|
||||
@@ -430,8 +445,9 @@ def measure_levels(r: StageResult, s: Strata, preset: dict, context: int, levels
|
||||
r.error(f"level {lv['key']}", e)
|
||||
if stt:
|
||||
busy = stt.finish()
|
||||
row["stt"].update({k: busy.get(k) for k in ("batch10_s", "single_s", "errors", "seconds")})
|
||||
for err in busy.get("errors") or []:
|
||||
row["stt"].update({k: busy.get(k) for k in ("status", "batch10_s", "single_s", "errors",
|
||||
"seconds")})
|
||||
for err in stt_gaps(busy):
|
||||
r.error(f"level {lv['key']} stt", err)
|
||||
else:
|
||||
r.error(f"level {lv['key']}", "the placement did not start")
|
||||
|
||||
Reference in New Issue
Block a user