Skip to content
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Only register shared memory on creation #119126

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Conversation

zetadin
Copy link

@zetadin zetadin commented May 17, 2024

gh-116849: Prevents multiple registration of SharedMemory with ResourceTracker.
Registering a SharedMemory location only once (on creation) will prevent multiple unlink attempts failing when ResourceTracker tries to unlink memory that has been registered multiple times (from different processes).

@zetadin zetadin requested a review from gpshead as a code owner May 17, 2024 18:58
Copy link

cpython-cla-bot bot commented May 17, 2024

All commit authors signed the Contributor License Agreement.
CLA signed

@bedevere-app
Copy link

bedevere-app bot commented May 17, 2024

Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool.

If this change has little impact on Python users, wait for a maintainer to apply the skip news label instead.

ResourceTracker of a child process should not raise warnings or try to clean up SharedMemory if it was created and is still in use by the parent process. Even if ResourceTracker was asked to track that memory. 
If that was allowed, an error is raised when the parent process tries to unlink the memory later.

Previous commit also makes manual unregistration from resource_tracker unneeded.
@bedevere-app
Copy link

bedevere-app bot commented May 17, 2024

Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool.

If this change has little impact on Python users, wait for a maintainer to apply the skip news label instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant