Repository navigation
Open
Labels
testsTests in the Lib/test dirTests in the Lib/test dirtopic-multiprocessingtype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
Description
Bug report
During build RPM for python3.11rc1 I've found tracebacks for tests from test suite test_multiprocessing_forkserver.py, test_multiprocessing_fork.py, and test_multiprocessing_spawn.py :
[root@xxx test]# python3.11 test_multiprocessing_forkserver.py
............s..................................................s...............................s.s.s.....s...s...........ss.....s......................................................................................................................................Traceback (most recent call last):
File "/opt/rh/rh-python311/root/usr/lib64/python3.11/multiprocessing/resource_tracker.py", line 209, in main
. cache[rtype].remove(name)
KeyError: '/psm_8714e59f'
..............................ssss...............................s.........ss.ss..sss.sss.s.ssss......ss....s.
----------------------------------------------------------------------
Ran 374 tests in 75.001s
OK (skipped=33)
[root@xxx test]# python3.11 test_multiprocessing_spawn.py
............s..............s...................................s...............................s.s.s.....s...s...........ss.....s...............................................................................................ss.....................................Traceback (most recent call last):
File "/opt/rh/rh-python311/root/usr/lib64/python3.11/multiprocessing/resource_tracker.py", line 209, in main
. cache[rtype].remove(name)
KeyError: '/psm_e93c9b17'
..............................ssss...............................s.........ss.ss..sss.sss.s.ssss......ss....s.
----------------------------------------------------------------------
Ran 374 tests in 118.379s
OK (skipped=36)
[root@xxx test]# python3.11 test_multiprocessing_fork.py
............s..............s...................................s...............................s.s.s.....s...s...........ss.....s........................................................................................s......ss.....................................Traceback (most recent call last):
File "/opt/rh/rh-python311/root/usr/lib64/python3.11/multiprocessing/resource_tracker.py", line 209, in main
. cache[rtype].remove(name)
KeyError: '/psm_1324c68a'
..............................ssss...............................s.........ss.ss..sss.sss.s.ssss......ss....s.
----------------------------------------------------------------------
Ran 374 tests in 67.935s
OK (skipped=37)
I suppose, that tracebacks are not ok during test. Or close the bug, if it normal.
Some KeyError are present in #95396.
Your environment
Python 3.11.0rc1 (main, Aug 13 2022, 18:23:13) [GCC 9.3.1 20200408 (Red Hat 9.3.1-2)] on linux
Centos7 x86_64, python 3.11rc1
Reacted by Andrin Schaller and Ran Benita
Metadata
Metadata
Assignees
Labels
testsTests in the Lib/test dirTests in the Lib/test dirtopic-multiprocessingtype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
Projects
- StatusShow more project fieldsNo status
Activity
serhiy-storchaka commentedon Aug 18, 2022
I seen this output many times, but cannot reproduce locally (on Ubuntu).
It is bad because it looks like an error even if test reports OK. It is mixed with real errors report and make it more difficult to analyze. It can also be a symptom of a problem with resource management.
sharewax commentedon Aug 18, 2022
As for KeyError
psmit looks like issues with shared memory. Some things was discussed in #91577.I see that in commit 9a458be was added
resource_tracker, maybe it's connected somehow.sharewax commentedon Aug 18, 2022
shared_memory.pySo if OSError exist, it tries to do
resource_tracker.unregisterwhich is contained inself.unlink(), but maybe it can be situation whenresource_tracker.registerwasn't register before?sharewax commentedon Aug 18, 2022
maybe connected with #89372 ?
I've found the test which reproduce this traceback
it is reproducable for
test_multiprocessing_fork,test_multiprocessing_forkserver,test_multiprocessing_spawnIn my case reverting patch f604cf1 doesn't produce any key error and other UserWarning.
So it's like specific for
Windowstests?Checked on current MacOS:
it tries to run
resource_tracker.unregisteron the resource which wasn't added into resource_tracker before.sergeykolosov commentedon Aug 22, 2022
I'm not entirely confident yet, but it appears that after 9a458be got merged, the workaround from f604cf1 is no longer needed (and causes the reported issue).
sharewax commentedon Aug 25, 2022
@tiran is it possible to fix it by reverting workaround as mentioned in comment by @sergeykolosov ?
tiran commentedon Aug 25, 2022
@sharewax Please refrain from pinging core developers on issues to draw their attention. It's distracting. Triagers may ping core devs or assign tickets that are listed as experts in https://devguide.python.org/core-developers/experts/index.html.
sharewax commentedon Aug 25, 2022
sorry for that :(
codeofandrin commentedon Jan 10, 2025
Also encountered this problem for Python 3.9.21 on macOS arm64.
pythongh-96026: do not unregister without register in shm POSIX error…