Multiprocessing Client connection, send call is blocking when multiple threads try to connect to IPC Server which is offline/down/not running
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 42/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Đình trệ
- Công nghệ
- python
- Lĩnh vực
- backend, networking
Hướng nghiên cứu
Bắt đầu từ entry point multiprocessing.connection.Client và tái hiện vấn đề trên Windows 10 với ba thread khi máy chủ IPC đang offline. Truy vết lý do chỉ một lệnh gọi trả về ngoại lệ từ chối kết nối; công việc được xem là hoàn tất khi mọi thread đều trả về thay vì tiếp tục bị chặn, kèm coverage hồi quy cho kịch bản này.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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.
- Ngôn ngữ chính
- Python
- Star
- 77.2k
- Fork
- 36k
- Merge trung bình
- 1 ngày 9 giờ
- Pull request đã merge (30 ngày)
- 558
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của python/cpython
-
docs pending
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
-
stdlib type-feature
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
-
stdlib type-feature
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
-
build type-bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
-
stdlib topic-email type-feature
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
Tất cả issue của python/cpython
Issue tương tự
-
link-check link-check:sphinx-theme
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
qgis/QGIS-Documentation#11275 ·
-
bug priority:normal ready-for-dev
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
OpenHands/extensions#626 · 1 bình luận ·
-
Change observation tooltip text Đang mở
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 90/100
CSCfi/sd-search-api#39 ·
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 90/100