tractor/ai/conc-anal
Gud Boi 54561959e6 Log subint bootstrap excs + cancel-leak state
Two diagnostic gaps in `tractor.spawn._subint.subint_proc()` that hid
otherwise-silent failures, plus tracking-issue links on the two open
`subint_forkserver` follow-ups.

Deats,
- bootstrap-exc visibility: wrap the call to
  `_interpreters.exec(interp_id, bootstrap)` with
  `try/except BaseException` + `log.exception(...)`.
  * Without it, an `ImportError` / `SyntaxError` raised inside the
    dedicated driver thread goes only to Python's default thread
    excepthook — invisible to the parent, which then waits forever on
    `subint_exited.wait()`.
  * `?TODO` notes `anyio`'s `to_interpreter._interp_call` +
    `(retval, is_exception)` pattern as the next step for re-raising;
    skipped now bc it must coordinate with the `trio.Cancelled` paths
    around the existing `.wait()` calls.

- cancel-leak disambiguation: when the driver thread doesn't exit within
  `_HARD_KILL_TIMEOUT`, also log `_interpreters.is_running(interp_id)`
  as `subint_still_running=...` so the operator can tell "thread leaked,
  subint already done" apart from "thread alive bc subint is wedged".
  * pattern borrowed from `trio-parallel`'s `_sint.SintWorker.is_alive()`.

- `?TODO` near the `bootstrap` literal: future switch to
  `_interpreters.set___main___attrs()` — same API `anyio`
  uses in `to_interpreter._Worker.call()` — for passing
  non-`repr()`-roundtrippable values (`SpawnSpec` struct, callables,
  etc).
  * add cross-refs tracking issue `#379`.

Also,
- `Tracked at: [#449]` link on
  `subint_forkserver_test_cancellation_leak_issue.md`.
- `Tracked at: [#450]` link on
  `subint_forkserver_thread_constraints_on_pep684_issue.md`.

(this commit msg was generated in some part by [`claude-code`][claude-code-gh])
[claude-code-gh]: https://github.com/anthropics/claude-code
2026-04-27 15:57:55 -04:00
..
subint_cancel_delivery_hang_issue.md Doc `subint` backend hang classes + arm `dump_on_hang` 2026-04-23 18:47:49 -04:00
subint_fork_blocked_by_cpython_post_fork_issue.md Doc `subint_fork` as blocked by CPython post-fork 2026-04-23 18:48:06 -04:00
subint_fork_from_main_thread_smoketest.py Add trio-parent tests for `_subint_forkserver` 2026-04-23 18:48:34 -04:00
subint_forkserver_mp_shared_memory_issue.md Add `--shm` orphan sweep to `tractor-reap` 2026-04-27 11:35:33 -04:00
subint_forkserver_orphan_sigint_hang_issue.md Refine `subint_forkserver` orphan-SIGINT diagnosis 2026-04-23 18:48:34 -04:00
subint_forkserver_test_cancellation_leak_issue.md Log subint bootstrap excs + cancel-leak state 2026-04-27 15:57:55 -04:00
subint_forkserver_thread_constraints_on_pep684_issue.md Log subint bootstrap excs + cancel-leak state 2026-04-27 15:57:55 -04:00
subint_sigint_starvation_issue.md Expand `subint` sigint-starvation hang catalog 2026-04-23 18:47:49 -04:00