This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: test_multiprocessing_forkserver: test_shared_memory_basics() failed with FileExistsError: [Errno 17] File exists: '/test01_tsmb'
Type: Stage: resolved
Components: Tests Versions: Python 3.11, Python 3.10, Python 3.9
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: lukasz.langa, miss-islington, pablogsal, serhiy.storchaka, vstinner
Priority: normal Keywords: patch

Created on 2021-09-28 12:22 by vstinner, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 28661 merged serhiy.storchaka, 2021-09-30 19:48
PR 28669 merged miss-islington, 2021-10-01 07:56
PR 28670 merged serhiy.storchaka, 2021-10-01 08:03
PR 28979 merged vstinner, 2021-10-15 13:47
Messages (6)
msg402770 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2021-09-28 12:22
AMD64 Fedora Stable LTO + PGO 3.10 (build 357):
https://buildbot.python.org/all/#/builders/651/builds/357

First test_multiprocessing_forkserver failed, then test_multiprocessing_spawn, then test_multiprocessing_fork.

I confirm that these tests fail if the /test01_tsmb shared memory exists.

The test is supposed to unlink the shared memory once the test completes:

    def test_shared_memory_basics(self):
        sms = shared_memory.SharedMemory('test01_tsmb', create=True, size=512)
        self.addCleanup(sms.unlink)

Maybe the whole process was killed while the test was running.

I removed it manually:

    sudo ./python -c "import _posixshmem; _posixshmem.shm_unlink('/test01_tsmb')"

Logs:

Traceback (most recent call last):
  File "/home/buildbot/buildarea/3.10.cstratak-fedora-stable-x86_64.lto-pgo/build/Lib/multiprocessing/resource_tracker.py", line 209, in main
    cache[rtype].remove(name)
KeyError: '/psm_49a93592'
(...)
======================================================================
ERROR: test_shared_memory_basics (test.test_multiprocessing_forkserver.WithProcessesTestSharedMemory)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/buildbot/buildarea/3.10.cstratak-fedora-stable-x86_64.lto-pgo/build/Lib/test/_test_multiprocessing.py", line 3777, in test_shared_memory_basics
    sms = shared_memory.SharedMemory('test01_tsmb', create=True, size=512)
  File "/home/buildbot/buildarea/3.10.cstratak-fedora-stable-x86_64.lto-pgo/build/Lib/multiprocessing/shared_memory.py", line 103, in __init__
    self._fd = _posixshmem.shm_open(
FileExistsError: [Errno 17] File exists: '/test01_tsmb'
msg402998 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2021-10-01 07:56
New changeset eb4495e8e275c83d691add116c4f2b74e73e3cc8 by Serhiy Storchaka in branch 'main':
bpo-45310: Fix parrallel shared memory tests (GH-28661)
https://github.com/python/cpython/commit/eb4495e8e275c83d691add116c4f2b74e73e3cc8
msg403004 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2021-10-01 09:38
New changeset 4d5d161d2aae41738d28e22bac5e1e08c01394bb by Serhiy Storchaka in branch '3.9':
[3.9] bpo-45310: Fix parrallel shared memory tests (GH-28661) (GH-28670)
https://github.com/python/cpython/commit/4d5d161d2aae41738d28e22bac5e1e08c01394bb
msg403005 - (view) Author: miss-islington (miss-islington) Date: 2021-10-01 09:41
New changeset 4e6681d0cf9e7ce5621c34ff87055fa1f9786108 by Miss Islington (bot) in branch '3.10':
bpo-45310: Fix parrallel shared memory tests (GH-28661)
https://github.com/python/cpython/commit/4e6681d0cf9e7ce5621c34ff87055fa1f9786108
msg403171 - (view) Author: Pablo Galindo Salgado (pablogsal) * (Python committer) Date: 2021-10-04 19:18
New changeset bc4c705869d4a24fc137a81df913869aa51d60d2 by Pablo Galindo (Miss Islington (bot)) in branch '3.10':
bpo-45310: Fix parrallel shared memory tests (GH-28661)
https://github.com/python/cpython/commit/bc4c705869d4a24fc137a81df913869aa51d60d2
msg404339 - (view) Author: Łukasz Langa (lukasz.langa) * (Python committer) Date: 2021-10-19 19:15
New changeset 7f70ba36706219181546c05363097f732827a081 by Victor Stinner in branch '3.8':
bpo-45310: Fix parrallel shared memory tests (GH-28661) (GH-28979)
https://github.com/python/cpython/commit/7f70ba36706219181546c05363097f732827a081
History
Date User Action Args
2022-04-11 14:59:50adminsetgithub: 89473
2021-10-19 19:15:10lukasz.langasetnosy: + lukasz.langa
messages: + msg404339
2021-10-15 13:47:36vstinnersetpull_requests: + pull_request27267
2021-10-04 19:18:43pablogsalsetnosy: + pablogsal
messages: + msg403171
2021-10-01 10:09:29serhiy.storchakasetstatus: open -> closed
resolution: fixed
stage: patch review -> resolved
2021-10-01 09:41:24miss-islingtonsetmessages: + msg403005
2021-10-01 09:38:31serhiy.storchakasetmessages: + msg403004
2021-10-01 08:03:30serhiy.storchakasetpull_requests: + pull_request27035
2021-10-01 07:56:40miss-islingtonsetnosy: + miss-islington
pull_requests: + pull_request27034
2021-10-01 07:56:36serhiy.storchakasetmessages: + msg402998
2021-09-30 19:49:09serhiy.storchakasetversions: + Python 3.9, Python 3.10
2021-09-30 19:48:32serhiy.storchakasetkeywords: + patch
nosy: + serhiy.storchaka

pull_requests: + pull_request27026
stage: patch review
2021-09-28 12:22:18vstinnercreate