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

gh-99595: Fix bug in multiprocessing.managers.BaseProxy that causes AttributeError when passing a proxy between processes #99598

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

Conversation

doloopuntil
Copy link

@doloopuntil doloopuntil commented Nov 19, 2022

When a proxy derived from multiprocessing.managers.BaseProxy is passed between processes, the self._manager attribute becomes None. self._manager is however accessed to retrieve its _registry attribute, which contain the method_to_typeid map recorded into the manager viaBaseManager.register(), causing an AttributeError. The solution is to decouple the role of the manager from the role of the registry and propagate the registry separately.

doloopuntil added 2 commits Nov 19, 2022
…ssing a proxy between processes

When a proxy derived from multiprocessing.managers.BaseProxy is passed between
processes, the self._manager attribute becomes None. self._manager is however
accessed to retrieve its _registry attribute, which contain the
method_to_typeid map recorded into the manager viaBaseManager.register(),
causing an AttributeError.
…uses AttributeError when passing a proxy between processes

Decouple the role of the manager from the role of the registry in the proxy and
initialize the proxy with the registry instance separately from the manager
instance.
@cpython-cla-bot
Copy link

cpython-cla-bot bot commented Nov 19, 2022

All commit authors signed the Contributor License Agreement.
CLA signed

@bedevere-bot
Copy link

bedevere-bot commented Nov 19, 2022

Most changes to Python require a NEWS entry.

Please add it using the blurb_it web app or the blurb command-line tool.

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

2 participants