tractor/tractor/spawn
Gud Boi 99541feec7 Bound subint teardown shields with hard-kill timeout
Unbounded `trio.CancelScope(shield=True)` at the
soft-kill and thread-join sites can wedge the parent
trio loop indefinitely when a stuck subint ignores
portal-cancel (e.g. bc the IPC channel is already
broken).

Deats,
- add `_HARD_KILL_TIMEOUT` (3s) module-level const
- wrap both shield sites with
  `trio.move_on_after()` so we abandon a stuck
  subint after the deadline
- flip driver thread to `daemon=True` so proc-exit
  also isn't blocked by a wedged subint
- pass `abandon_on_cancel=True` to
  `trio.to_thread.run_sync(driver_thread.join)`
  — load-bearing for `move_on_after` to actually
  fire
- log warnings when either timeout triggers
- improve `InterpreterError` log msg to explain
  the abandoned-thread scenario

(this patch was generated in some part by [`claude-code`][claude-code-gh])
[claude-code-gh]: https://github.com/anthropics/claude-code
2026-04-23 18:47:49 -04:00
..
__init__.py Restore fn-arg `_runtime_vars` in `trio_proc` teardown 2026-04-23 18:30:11 -04:00
_entry.py Tidy `spawn/` subpkg docstrings and imports 2026-04-17 19:03:00 -04:00
_forkserver_override.py Mv core mods to `runtime/`, `spawn/`, `discovery/` subpkgs 2026-04-02 17:59:13 -04:00
_mp.py Tidy `spawn/` subpkg docstrings and imports 2026-04-17 19:03:00 -04:00
_mp_fixup_main.py Fix typos + typing in `_mp_fixup_main` 2026-04-10 20:58:54 -04:00
_spawn.py Doc the `_interpreters` private-API choice in `_subint` 2026-04-23 18:47:49 -04:00
_subint.py Bound subint teardown shields with hard-kill timeout 2026-04-23 18:47:49 -04:00
_trio.py Restore fn-arg `_runtime_vars` in `trio_proc` teardown 2026-04-23 18:30:11 -04:00