python / python/cpython

Sharing instance of proxy object across processes results in pickle errors

Open
#101,320 11 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

topic-multiprocessing type-bug
Dominant language
Python
Stars
77.2k
Forks
36k
PR merge metrics
PR metrics pending

Description

Hello

I'm trying to understand if a SyncManager proxy object instances are supposed to be shareable accoss processes, and if so, how

Bug report

See https://github.com/python/cpython/issues/101320#issuecomment-1404187868 below

What I'm doing is the following:

  • create a new sync manager, and use it to populate a proxy dictionary from the initial process
  • in another process, connect to the sync manage, and read in a load the data from the proxy dictionary
  • we read corrupted data out of the connection to the manager

Is this a bug or something that should be possible to do in python ?
I assume that the objects in syncmanager can be accessed through several processes, is it true ?
If so, what is the proper way to do it ? (I think that just using the same reference of proxy object accross forked processes is not supposed to work)

Your environment

python 3.9

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the SyncManager proxy-sharing scenario described in the report and read the linked issue comment for the observed pickle errors. Reproduce the sequence across processes on Python 3.9, then determine whether the corrupted data is expected behavior or a defect and document a confirmed outcome.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
operating-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.