-
-
Notifications
You must be signed in to change notification settings - Fork 31.3k
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
bpo-38119: Fix shmem resource tracking #15989
Conversation
…ndle after any one independent process exit.
Updated PR fixing merge conflicts. |
@lihaoxiang1989 , this PR has merge conflicts, I have created a PR fixing those, containing the same changes. Can you approve that instead. |
Hello Team, May I know, once the PR is merged, how can I get the fix on Ubuntu 18.04? |
@lthakur007 , these changes are now being tracked by #21516, once those changes are merged you can either wait for an alpha or beta tag release, or you can directly build python from source (master). |
Thank you for the response. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good idea,it works,nice job!
Astonishing that this is still not merged... I've been manually unregistering shared memory from child processes for the last year. What's the point of shared memory if it doesn't persist between processes by default... |
any news on this? |
@jcarlitooliveira Does #82300 help you in any way? |
there's an updated PR mentioned above: #21516 - it has a lot more discussion on it so i'm closing this earlier version of the proposed change. |
im using this monkey patch at the beginning of the application: TODO: CHANGE FIX REGISTER/UNREGISTER TO INCLUDE SEMAPHORESdef remove_shm_from_resource_tracker():
|
Eliminates the use of the resource tracker on shared memory segments but preserves its use on semaphores, etc. where it is appropriately applied.
Adds a test that fails with the current code (an independent Python process started via subprocess accesses shared memory created by a different Python process, then exits normally, expecting the original creator process to continue to be able to access that shared memory) but passes with this patch to defend against future regressions.
https://bugs.python.org/issue38119