File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -217,7 +217,7 @@ addopts = [
217217 ' --show-capture=no' ,
218218
219219 # sys-level capture. REQUIRED for fork-based spawn
220- # backends (e.g. `subint_forkserver `): default
220+ # backends (e.g. `main_thread_forkserver `): default
221221 # `--capture=fd` redirects fd 1,2 to temp files, and fork
222222 # children inherit those fds — opaque deadlocks happen in
223223 # the pytest-capture-machinery ↔ fork-child stdio
Original file line number Diff line number Diff line change @@ -538,13 +538,13 @@ async def kill_transport(
538538@pytest .mark .timeout (
539539 30 ,
540540 # NOTE should be a 2.1s happy path.
541- # XXX for `subint_forkserver ` this is SUPER SENSITIVE so keep it
542- # higher to avoid flaky runs..
541+ # XXX for `main_thread_forkserver ` this is SUPER SENSITIVE
542+ # so keep it higher to avoid flaky runs..
543543 method = 'thread' ,
544544)
545545@pytest .mark .skipon_spawn_backend (
546546 'subint' ,
547- # 'subint_forkserver ',
547+ # 'main_thread_forkserver ',
548548 reason = (
549549 'XXX SUBINT HANGING TEST XXX\n '
550550 'See oustanding issue(s)\n '
Original file line number Diff line number Diff line change @@ -452,8 +452,12 @@ async def spawn_and_error(
452452 await nursery .run_in_actor (* args , ** kwargs )
453453
454454
455- # NOTE: subint_forkserver skip handled by file-level `pytestmark`
456- # above (same pytest-capture-fd hang class as siblings).
455+ # NOTE: `main_thread_forkserver` capture-fd hang class is no
456+ # longer skipped here — `--capture=sys` (the new `pyproject.toml`
457+ # default) sidesteps the pipe-buffer-fill deadlock for
458+ # `test_nested_multierrors`. See
459+ # `ai/conc-anal/subint_forkserver_test_cancellation_leak_issue.md`
460+ # / #449 for the post-mortem.
457461@pytest .mark .timeout (
458462 10 ,
459463 method = 'thread' ,
Original file line number Diff line number Diff line change @@ -1113,7 +1113,7 @@ async def main():
11131113 if (
11141114 send_sigint_to == 'child'
11151115 and
1116- start_method == 'subint_forkserver '
1116+ start_method == 'main_thread_forkserver '
11171117 ):
11181118 pytest .xfail (
11191119 reason = (
Original file line number Diff line number Diff line change 1616
1717pytestmark = pytest .mark .skipon_spawn_backend (
1818 'subint' ,
19- # 'subint_forkserver',
20- # XXX we hack around this stdlib limitation by both,
21- # - setting `ShareMemory(track=False)`
22- # - overriding the `mp.ResourceTracker` nonsense in
23- # `.ipc._mp_bs`.
19+ # NOTE, `main_thread_forkserver` works for these tests
20+ # via the `mp.SharedMemory(track=False)` +
21+ # `mp.resource_tracker` monkey-patch in `.ipc._mp_bs`.
22+ # Without that workaround the fork-inherited
23+ # `resource_tracker` fd would EBADF on first shm op +
24+ # cascade into `FileExistsError` across parametrize
25+ # variants. Tracker doc:
26+ # `ai/conc-anal/subint_forkserver_mp_shared_memory_issue.md`.
2427 reason = (
2528 'subint: GIL-contention hanging class.\n '
26- 'subint_forkserver: `multiprocessing.SharedMemory` '
27- 'is fork-without-exec unsafe — child inherits parent\' s '
28- '`resource_tracker` fd → EBADF on first shm op '
29- '(`test_child_attaches_alot`); leaked `/shm_list` from '
30- 'a "passing" run cascades into `FileExistsError` across '
31- 'parametrize variants (`test_parent_writer_child_reader`). '
32- 'Canonical CPython issue class, NOT a tractor bug; full '
33- 'tracker doc:\n '
34- 'ai/conc-anal/subint_forkserver_mp_shared_memory_issue.md'
3529 )
3630)
3731
Original file line number Diff line number Diff line change @@ -194,7 +194,7 @@ def test_loglevel_propagated_to_subactor(
194194 reg_addr : tuple ,
195195 level : str ,
196196):
197- if start_method in ('mp_forkserver' , 'subint_forkserver ' ):
197+ if start_method in ('mp_forkserver' , 'main_thread_forkserver ' ):
198198 pytest .skip (
199199 "a bug with `capfd` seems to make forkserver capture not work? "
200200 "(same class as the `mp_forkserver` pre-existing skip — fork-"
Original file line number Diff line number Diff line change 7979 'trio' ,
8080 # forkserver children run `_trio_main` in their own OS
8181 # process — same child-side runtime shape as `trio_proc`.
82- 'subint_forkserver ' ,
82+ 'main_thread_forkserver ' ,
8383)
8484
8585
Original file line number Diff line number Diff line change @@ -303,7 +303,7 @@ def _reap_orphaned_subactors():
303303 grace window, then SIGKILL survivors.
304304
305305 Rationale: under fork-based spawn backends (notably
306- `subint_forkserver `), a test that times out or bails
306+ `main_thread_forkserver `), a test that times out or bails
307307 mid-teardown can leave subactor forks alive. Without
308308 this reap, they linger across sessions and compete
309309 for ports / inherit pytest's capture-pipe fds — which
Original file line number Diff line number Diff line change @@ -1763,7 +1763,7 @@ async def async_main(
17631763 # shielded loop would park on the parent chan
17641764 # indefinitely waiting for EOF that only arrives
17651765 # after the PARENT tears down, which under
1766- # fork-based backends (e.g. `subint_forkserver `)
1766+ # fork-based backends (e.g. `main_thread_forkserver `)
17671767 # it waits on THIS actor's exit — deadlock.
17681768 actor ._parent_chan_cs = await root_tn .start (
17691769 partial (
Original file line number Diff line number Diff line change @@ -122,8 +122,8 @@ def update(
122122# `open_root_actor()` nor received a parent `SpawnSpec`. Kept
123123# as a module-level constant so `get_runtime_vars(clear_values=
124124# True)` can reset the live dict back to this baseline (see
125- # `tractor.spawn._subint_forkserver ` for the one current caller
126- # that needs it).
125+ # `tractor.spawn._main_thread_forkserver ` for the one current
126+ # caller that needs it).
127127_RUNTIME_VARS_DEFAULTS : dict [str , Any ] = {
128128 # root of actor-process tree info
129129 '_is_root' : False , # bool
@@ -165,7 +165,7 @@ def get_runtime_vars(
165165 defaults (`_RUNTIME_VARS_DEFAULTS`) instead of the live
166166 dict. Useful in combination with `set_runtime_vars()` to
167167 reset process-global state back to "cold" — the main caller
168- today is the `subint_forkserver ` spawn backend's post-fork
168+ today is the `main_thread_forkserver ` spawn backend's post-fork
169169 child prelude:
170170
171171 set_runtime_vars(get_runtime_vars(clear_values=True))
You can’t perform that action at this time.
0 commit comments