python / python/cpython

Sharing instance of proxy object across processes results in pickle errors

未关闭
#101,320 11 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

topic-multiprocessing type-bug
主要语言
Python
星标
77.2k
派生
36k
平均合并
1 天 9 小时
30 天内合并 PR
558

描述

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

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

调研方向

从报告中描述的 SyncManager 代理共享场景开始,并阅读链接的 issue 评论中关于所观察到的 pickle 错误的内容。在 Python 3.9 上跨进程重现该序列,然后确定损坏的数据是预期行为还是缺陷,并记录已确认的结果。

由索引模型根据 Issue 内容生成。

评估

技术栈
python
领域
operating-systems
Issue 类型
缺陷
难度
4/5
预计耗时
3-5 天
活跃度
停滞
描述清晰度
需要澄清
新手友好度
30/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。