Skip to content

Conversation

@DinoV
Copy link
Contributor

@DinoV 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

@iritkatriel
Copy link
Member

https://bugs.python.org/issue38076 is closed. What is the status of this PR?

@kumaraditya303
Copy link
Contributor

kumaraditya303 commented Jan 1, 2023

There are merge conflicts, please create an issue to discuss the change first.

@DinoV DinoV deleted the fix_crash branch May 31, 2024 18:23
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.

6 participants