tts-voice-creator-clone-and.../static
mARTin-B78 ce3ae79132 Fix streams permanently stuck holding the shared LLM lock (v1.14.2)
Confirmed in production: a streaming attribution/character-sheets
request held _attribution_llm_lock for 11+ minutes, well past its
configured timeout, silently rejecting every subsequent passage as
"Attribution engine busy" and falling back to the non-streaming view -
looking exactly like live-thinking had stopped working, when actually
one earlier request never finished.

Root cause: requests' timeout= on a stream=True call only covers the
connect + first byte, not gaps between later body reads. If the LLM
backend goes silent mid-stream (connection left open, no more chunks),
the blocked socket recv() inside iter_lines() can hang indefinitely.
Since that's a native blocking call, not a Python-level yield point,
neither an in-loop wall-clock check nor GeneratorExit from a
disconnected client can interrupt it - both only take effect at the
next bytecode boundary, which never arrives while blocked in the C
extension.

Added _watchdog_close: a daemon thread that force-closes the upstream
connection if the wrapped block hasn't finished within the configured
timeout. Closing the socket from another thread makes the blocked
recv() raise, unblocking the generator so its normal except/finally
cleanup (including releasing the lock) actually runs. Verified against
the live LLM backend post-restart: stream completes normally with
real token-by-token deltas, and the lock is confirmed free immediately
after.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-06 20:57:49 +02:00
..
js Fix PDF-parsing progress pill drifting toward the bottom (v1.14.1) 2026-07-06 16:14:54 +02:00
sections Declutter Read Aloud toolbar: drop redundant Character sheets button (v1.13.8) 2026-07-06 15:01:56 +02:00
vendor Add skeleton loading, self-host assets, fix LLM empty response 2026-05-29 17:28:42 +02:00
icon.svg Release v1.6.0: a11y (WCAG AA), i18n (DE), PWA, perf, tests, Cast UX 2026-06-03 14:23:35 +02:00
index.html Fix streams permanently stuck holding the shared LLM lock (v1.14.2) 2026-07-06 20:57:49 +02:00
loader.js Optimize startup and persist engine keys 2026-06-30 14:52:17 +02:00
manifest.webmanifest Release v1.6.0: a11y (WCAG AA), i18n (DE), PWA, perf, tests, Cast UX 2026-06-03 14:23:35 +02:00
nav.js Add Casting back-navigation, fix truncated prompt generation (v1.12.91) 2026-07-04 17:43:51 +02:00
style.css Add live-streaming output to Character Sheets generation (v1.14.0) 2026-07-06 15:28:26 +02:00
sw.js Release v1.6.0: a11y (WCAG AA), i18n (DE), PWA, perf, tests, Cast UX 2026-06-03 14:23:35 +02:00