Inconsistent behaviour of multiprocessing.shared_memory
まだ誰も着手していません。
- 主要言語
- Python
- スター
- 77.2k
- フォーク
- 35.9k
- PR マージ指標
- PR 指標を取得中
説明
Bug report
Bug description:
An example code already exists in the documentation (see from here: The following example demonstrates a practical use of the SharedMemory class with NumPy arrays, accessing the same numpy.ndarray from two distinct Python shells).
The code executes fine as expected and mentioned there until one closes the terminals which report warnings.
When the second terminal is closed: /home/souradeep/miniconda/envs/py39/lib/python3.9/multiprocessing/resource_tracker.py:216: UserWarning: resource_tracker: There appear to be 1 leaked shared_memory objects to clean up at shutdown
warnings.warn('resource_tracker: There appear to be %d '
and when the first terminal is closed: /home/souradeep/miniconda/envs/py39/lib/python3.9/multiprocessing/resource_tracker.py:229: UserWarning: resource_tracker: '/trial': [Errno 2] No such file or directory: '/trial'
This can have implications when one tries to use the feature somewhere in an application (see an example).
CPython versions tested on:
3.9
Operating systems tested on:
Linux
Linked PRs
- gh-119126
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
multiprocessing のドキュメントにある共有メモリの例から始め、multiprocessing/resource_tracker.py を調査します。報告で再現されているシャットダウン時の警告に注目してください。リンクされている PR gh-119126 と、そのテストがあれば確認します。ドキュメント化された例がシャットダウン時に報告された resource-tracker の警告を生成しなくなれば、issue は完了です。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- python
- 領域
- operating-systems
- issue の種類
- バグ
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 活発さ
- 停滞
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 25/100