Multiprocessing Client connection, send call is blocking when multiple threads try to connect to IPC Server which is offline/down/not running
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 42/100
- issue の種類
- バグ
- 明瞭さ
- おおむね明確
- 活発さ
- 停滞
- 技術スタック
- python
- 領域
- backend, networking
調査の方向性
multiprocessing.connection.Client のエントリーポイントから開始し、IPC サーバーがオフラインの状態で、Windows 10 上で 3 つのスレッドを使って問題を再現します。なぜ 1 つの呼び出しだけが接続拒否例外を返すのかを追跡します。完了の条件は、このシナリオの回帰カバレッジを用意し、すべてのスレッドがブロックされたままにならずに戻ることです。
索引モデルが issue の本文から書いたものです。
説明
Bug report
When multiple threads access send call of multiprocessing Client to connect to server via IPC, the threads are blocked forever. This occurs when IPC server is down and the client tries to connect to server.
CODE:
from multiprocessing.connection import Client
def ipc_send(data={}):
try:
address = ('localhost', 56000)
print("ipc address: ", address)
conn = Client(address, authkey="SOMESECRET")
conn.send(data)
res = conn.recv()
conn.close()
return True
except Exception as e:
print(e)
return None
As server is down, when ipc_send() is called by 3 different threads(including main thread), suprisingly only one thread has returned None with exception: [WinError 10061] No connection could be made because the target machine actively refused it.
It is trivial that Error would be connection refused as server is down, but only one thread has thrown the error and rest of the 2 threads are possibly blocked at
conn = Client(address, authkey="SOMESECRET")
Your environment
Python 3.8.8
OS: Windows 10.
- 主要言語
- Python
- スター
- 77.2k
- フォーク
- 36k
- 平均マージ
- 1日 9時間
- マージ済み PR(30日)
- 558
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
python/cpython のほかの issue
-
docs pending
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
-
stdlib type-feature
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
-
stdlib type-feature
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
-
build type-bug
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
-
stdlib topic-email type-feature
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 86/100
-
🐛 Bug 🔔 Pending processing
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
jumpserver/jumpserver#17584 ·