Phantom time?
還沒有人認領這個 Issue。
評估
- 難度
- 3/5
- 預估耗時
- 1-2 天
- 新手友好度
- 48/100
- Issue 類型
- 缺陷
- 描述清晰度
- 基本清楚
- 活躍度
- 停滯
- 技術堆疊
- python
- 領域
- networking
研究方向
先閱讀 socketpool/backend_thread.py,特別是 run 以及模組層級的 time.sleep 參照,接著重現 issue 中描述的執行緒 shutdown traceback。確認 time 為何會變成 None,以及儲存的 sleep 參照是否旨在防止這種情況;完成的標準是已了解並處理 shutdown exception 及其影響。
由索引模型根據 Issue 內容生成。
描述
I frequently see the following error in logs when socketpool is used from inside a thread (via threading module). I'm unaware if the time module or socketpool are inherently un-thread-safe, nor can I tell if there are any negative effects of the issue. It is quite bizarre though:
The exception:
Exception in thread Thread-1 (most likely raised during interpreter shutdown):
Traceback (most recent call last):
File "/usr/lib/python2.7/threading.py", line 810, in __bootstrap_inner
File "/opt/webapps/filmbot/venv/local/lib/python2.7/site-packages/socketpool/backend_thread.py", line 50, in run
<type 'exceptions.AttributeError'>: 'NoneType' object has no attribute 'sleep'
The related code:
def run(self):
self.running = True
while True:
time.sleep(self.delay)
self.pool.murder_connections()
where somehow time has become None.
I see at the top of the backend_thread module that the author assigns a reference to time.sleep, yet never uses the reference and instead still accesses sleep from the time import. Not sure what the utility of that is, or if it's an omission, etc.
- 主要語言
- Python
- 星號
- 165
- 分支
- 33
- PR 合併指標
- 30 天內沒有已合併 PR
環境準備
這個專案沒有提供開發容器、Dockerfile 或貢獻指南,環境需要你自己搭建:先看它的 README,通用步驟見我們的新手貢獻指南。
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
benoitc/socketpool 的其他 Issue
-
難度 3/5 1-2 天 新手友好度 45/100
benoitc/socketpool#38 ·
-
難度 3/5 1-2 天 新手友好度 25/100
benoitc/socketpool#35 · 2 則留言 ·
-
Please .....未關閉
難度 5/5 一週以上 新手友好度 20/100
benoitc/socketpool#30 · 1 則留言 ·
-
難度 1/5 1 小時以內 新手友好度 48/100
benoitc/socketpool#28 ·
-
難度 4/5 3-5 天 新手友好度 35/100
benoitc/socketpool#26 ·
查看 benoitc/socketpool 的全部 Issue
相似的 Issue
-
難度 2/5 1-3 小時 新手友好度 62/100
openvinotoolkit/openvino_notebooks#3858 ·
維護者通常 1 天內回覆
-
bug
難度 1/5 1 小時以內 新手友好度 88/100
hummingbot/hummingbot-api#256 ·
-
bug
難度 2/5 1-3 小時 新手友好度 80/100
-
area:other help wanted
難度 2/5 1-3 小時 新手友好度 70/100
WingedGuardian/GENesis-AGI#4734 ·
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 70/100
peach-mitao/peach#693 ·
維護者通常 1 天內回覆