lumbda/wasm
russell@unturf.com 2ed5be124c
repl: timeout the auto-pause snapshot so a non-yielding worker dies
If the C/Python eval was stuck in code without a poll site (sync XHR
inside bend!-call, a builtin that doesn't pass through leval), the
SAB pause flag would set, waitForPending would time out after 5s,
and then portal-snapshot would queue behind the still-busy worker
and never resolve. autoPauseTab hung on that await and never
reached its terminate loop — leaving the worker running while the
user sat on a new tab watching the old loop keep streaming.

Now:
* SAB pause wait drops from 5s to 2s.
* If the eval is still in flight after the pause wait, skip the
  snapshot attempt entirely — the worker isn't yielding and the
  snapshot would just hang the UI.
* Snapshot eval + portal-save bridge are wrapped in withTimeout
  (2s + 1.5s) so even if pause partially worked but snapshot
  stalled, we fall through to the unconditional worker.terminate
  at the bottom of autoPauseTab.
* The hard-cancel branch and the SAB-timeout-fallback now share the
  same pending-rejection loop instead of duplicating; the
  unconditional terminate loop at the end kills the worker.

pauseAndSnapshot (manual ⏸ button) also surfaces the timeout case
with an alert pointing at cancel + reboot instead of locking the UI.
2026-06-15 13:47:20 -04:00
..
app repl: auto-pause + portal-save when leaving a tab mid-eval, resume on return 2026-06-15 09:02:53 -04:00
asm asm streaming: recycle the 64 KB output buffer after each flush 2026-06-15 06:36:00 -04:00
c repl: auto-pause + portal-save when leaving a tab mid-eval, resume on return 2026-06-15 09:02:53 -04:00
dist-repl repl: timeout the auto-pause snapshot so a non-yielding worker dies 2026-06-15 13:47:20 -04:00
python python tier: SAB-backed pause poll — auto-pause now works on python too 2026-06-15 11:16:50 -04:00
repl repl: timeout the auto-pause snapshot so a non-yielding worker dies 2026-06-15 13:47:20 -04:00
tests wasm asm: stream output line-by-line via new emit_chunk env import 2026-06-14 20:35:13 -04:00
Makefile repl: auto-pause + portal-save when leaving a tab mid-eval, resume on return 2026-06-15 09:02:53 -04:00
serve-coop.py repl: auto-pause + portal-save when leaving a tab mid-eval, resume on return 2026-06-15 09:02:53 -04:00