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

bpo-38076: Fix crash on shutdown caused by PEP-384ification of _struct #18038

Open
wants to merge 1 commit into
base: master
from

Conversation

@DinoV
Copy link
Contributor

DinoV commented Jan 17, 2020

I think this is a partial fix for _struct crashing on shutdown after the PEP-384ification of it when using the multi-processing class with a finalizer:

from multiprocessing.pool import Pool
class A(object):
def init(self):
self.pool = Pool()
def del(self):
self.pool.close()
self.pool.join()
a = A()

Although I still see this hanging on Linux instead of cleaning shutting down.

There are still some other issues related to shutdown that this doesn't yet fix. Fixing other cases will likely require storing the module object off of the struct type object so that it can be retrieved later.

Feedback welcome, it might be better to fix this in a global manner by changing the finalization code to not clear the module list so early, but that seems like a much more significant change.

https://bugs.python.org/issue38076

Summary:

Test Plan:

Reviewers:

Subscribers:

Tasks:

Tags:
@DinoV DinoV force-pushed the DinoV:fix_crash branch from 9c899ca to b2c50be Jan 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.