Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

gh-82300: Add track parameter to shared memory#110778

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
gpshead merged 28 commits intopython:mainfrompan324:shmemuntrack
Dec 5, 2023
Merged
Changes from1 commit
Commits
Show all changes
28 commits
Select commitHold shift + click to select a range
3be08b4
add track parameter to shared memory
pan324Oct 12, 2023
f50812a
phrasing
pan324Oct 12, 2023
cbc8431
📜🤖 Added by blurb_it.
blurb-it[bot]Oct 12, 2023
7138447
phrasing
pan324Oct 12, 2023
6bbfca6
Merge branch 'main' of https://github.com/python/cpython into shmemun…
pan324Oct 12, 2023
db79426
Merge branch 'python:main' into shmemuntrack
pan324Oct 12, 2023
db11894
Merge branch 'shmemuntrack' of github.com:pan324/cpython into shmemun…
pan324Oct 12, 2023
d44cb82
Delete Doc/library/result.html
pan324Oct 12, 2023
c62cff0
Merge branch 'main' into shmemuntrack
ambvOct 13, 2023
dcda10f
Update Misc/NEWS.d/next/Library/2023-10-12-18-19-47.gh-issue-82300.P8…
pan324Oct 15, 2023
63d21d7
Update Doc/library/multiprocessing.shared_memory.rst
pan324Oct 15, 2023
e990e41
Update Doc/library/multiprocessing.shared_memory.rst
pan324Oct 15, 2023
9c593ba
Removed TypeError. Clarified documentation.
pan324Oct 17, 2023
9ef1ff3
untracking shmem can unlink now
pan324Oct 17, 2023
e5fe674
Update Doc/library/multiprocessing.shared_memory.rst
pan324Oct 19, 2023
66acf90
removed unneeded try-except
pan324Oct 19, 2023
3fdf625
phrasing of track parameter
pan324Oct 19, 2023
d65e3f8
Update Doc/library/multiprocessing.shared_memory.rst
pan324Oct 24, 2023
a97c6d3
untracking test
pan324Oct 24, 2023
17c07f5
untrack tests both track=True and track=False
pan324Oct 25, 2023
13f3fb6
untrack tests both track=True and track=False
pan324Oct 25, 2023
7c7f0e7
untrack tests both track=True and track=False
pan324Oct 25, 2023
765afb7
reliable test cleanup
pan324Nov 30, 2023
a5848c1
Update Doc/library/multiprocessing.shared_memory.rst
pan324Dec 1, 2023
8255e01
split tests
pan324Dec 1, 2023
5d89117
split tests
pan324Dec 1, 2023
66db5b8
style: add a missing blank line
gpsheadDec 2, 2023
52053f8
Merge branch 'main' into shmemuntrack
gpsheadDec 2, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
PrevPrevious commit
NextNext commit
split tests
  • Loading branch information
@pan324
pan324 committedDec 1, 2023
commit8255e015b61baeaca125e3196580c6c7721b91b6
10 changes: 8 additions & 2 deletionsLib/test/_test_multiprocessing.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -4444,8 +4444,7 @@ def test_shared_memory_cleaned_after_process_termination(self):
def test_shared_memory_untracking(self):
# gh-82300: When a separate Python process accesses shared memory
# with track=False, it must not cause the memory to be deleted
# when terminating. When accessing with track=True, it must be
# deleted.
# when terminating.
cmd = '''if 1:
import sys
from multiprocessing.shared_memory import SharedMemory
Expand All@@ -4457,6 +4456,7 @@ def test_shared_memory_untracking(self):
# err existing means that the tracker process has terminated now.
try:
rc, out, err = script_helper.assert_python_ok("-c", cmd, mem.name)
self.assertNotIn(b"resource_tracker", err)
self.assertEqual(rc, 0)
mem2 = shared_memory.SharedMemory(create=False, name=mem.name)
mem2.close()
Expand All@@ -4466,6 +4466,11 @@ def test_shared_memory_untracking(self):
except OSError:
pass
mem.close()
@unittest.skipIf(os.name != "posix", "resource_tracker is posix only")
def test_shared_memory_tracking(self):
# gh-82300: When a separate Python process accesses shared memory
# with track=True, it must cause the memory to be deleted when
# terminating.
cmd = '''if 1:
import sys
from multiprocessing.shared_memory import SharedMemory
Expand All@@ -4475,6 +4480,7 @@ def test_shared_memory_untracking(self):
mem = shared_memory.SharedMemory(create=True, size=10)
try:
rc, out, err = script_helper.assert_python_ok("-c", cmd, mem.name)
self.assertNotIn(b"resource_tracker", err)
self.assertEqual(rc, 0)
self.assertIn(
b"resource_tracker: There appear to be 1 leaked "
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp