Document `SharedMemory` × `subint_forkserver` incompat
New `ai/conc-anal/` doc: `mp.SharedMemory` is
fork-without-exec unsafe — child inherits parent's
`resource_tracker` fd → EBADF on first shm op;
leaked `/shm_list` cascades `FileExistsError`
across parametrize variants. Canonical CPython
issue class, NOT a tractor bug. Includes two
longer-term mitigation paths (reset inherited
tracker fd vs migrate off `mp.shared_memory`).
Also, update `tests/test_shm.py`:
- comment out `subint_forkserver` from skip list
- rewrite reason with precise failure-mode
descriptions + link to the analysis doc
(this patch was generated in some part by [`claude-code`][claude-code-gh])
[claude-code-gh]: https://github.com/anthropics/claude-code
(cherry picked from commit c99d475d03)
(factored: dropped spawn-backend-only paths: ai/conc-anal/subint_forkserver_mp_shared_memory_issue.md)
test_suite_hardening
parent
3fdf7595e5
commit
ec7efd792a
|
|
@ -16,10 +16,18 @@ from tractor.ipc._shm import (
|
||||||
|
|
||||||
pytestmark = pytest.mark.skipon_spawn_backend(
|
pytestmark = pytest.mark.skipon_spawn_backend(
|
||||||
'subint',
|
'subint',
|
||||||
|
# 'subint_forkserver',
|
||||||
reason=(
|
reason=(
|
||||||
'XXX SUBINT GIL-CONTENTION HANGING TEST XXX\n'
|
'subint: GIL-contention hanging class.\n'
|
||||||
'See oustanding issue(s)\n'
|
'subint_forkserver: `multiprocessing.SharedMemory` '
|
||||||
# TODO, put issue link!
|
'is fork-without-exec unsafe — child inherits parent\'s '
|
||||||
|
'`resource_tracker` fd → EBADF on first shm op '
|
||||||
|
'(`test_child_attaches_alot`); leaked `/shm_list` from '
|
||||||
|
'a "passing" run cascades into `FileExistsError` across '
|
||||||
|
'parametrize variants (`test_parent_writer_child_reader`). '
|
||||||
|
'Canonical CPython issue class, NOT a tractor bug; full '
|
||||||
|
'tracker doc:\n'
|
||||||
|
'ai/conc-anal/subint_forkserver_mp_shared_memory_issue.md'
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue