aioble: Unhandled exception in IRC callback - memory allocation failed
還沒有人認領這個 Issue。
評估
- 難度
- 4/5
- 預估耗時
- 3-5 天
- 新手友好度
- 35/100
- Issue 類型
- 缺陷
- 描述清晰度
- 需要釐清
- 活躍度
- 停滯
- 技術堆疊
- python
- 領域
- embedded-iot
研究方向
從 core.py 第 71 行和 central.py 第 61 行開始,這是 traceback 中顯示的 IRQ callback 路徑。與其他任務一起執行長時間運作的 aioble.scan 工作負載,並觀察 MemoryError 如何影響掃描任務。完成的標準是:已定義並驗證配置失敗時所需的行為,且不會悄悄停止背景掃描。
由索引模型根據 Issue 內容生成。
描述
Hi,
I have a function that scans for advertising data and decode the information (Ruuvi temperature sensors). However, when this runs for a while together with some other tasks, I'm running into a memory issue.
Unhandled exception in IRQ callback handler
Traceback (most recent call last):
File "core.py", line 71, in ble_irq
File "central.py", line 61, in _central_irq
MemoryError: memory allocation failed, allocating 2048 bytes
This will quit my background BLE scanning task which is updating my temperature data. Of course I can watch the task and restart it, but I hope for a better error handling the the aioble library.
It runs fine for quite some time before it giving the error. It's not reproducible - sometimes it occurs after 5 minutes, sometimes it runs 2h without any issues.
I tried running an exception catcher around the can itself:
try:
async with aioble.scan(duration_ms = duration, interval_us=30000, window_us=30000, active = True) as scanner:
self.scanner = scanner
async for result in scanner:
self._handle_advertisement(result)
except Exception as e:
print('!!!!! Exception in aioble scan')
print(e)
But this doesn't help to prevent the error from happing. Of course I could change the code in central.py myself and see if I can catch the error, but I don't want to mess around with it (yet).
I already have another task that is frequently running a gc.collect() and memory shows up with round 32kB.
Thanks....
- 主要語言
- Python
- 星號
- 2.9k
- 分支
- 1.1k
- PR 合併指標
- 30 天內沒有已合併 PR
環境準備
- 沒有 Dockerfile 或 Docker Compose 檔案
- 有 Pull Request 範本
- 閱讀貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
micropython/micropython-lib 的其他 Issue
-
難度 2/5 1-3 小時 新手友好度 62/100
micropython/micropython-lib#1074 ·
-
needs-info
難度 1/5 1 小時以內 新手友好度 72/100
micropython/micropython-lib#943 · 1 則留言 ·
-
"requests" does not handle redirection with relative path correctly可能重新可做 關聯的 PR 已關閉且未合併。 未關閉
難度 2/5 1-3 小時 新手友好度 68/100
micropython/micropython-lib#931 · 1 則留言 ·
-
難度 1/5 1 小時以內 新手友好度 62/100
micropython/micropython-lib#795 · 2 則留言 ·
-
webrepl: Support LAN as well as WLAN boards.可能已有人在做 @Romaric-RILLET 於 774 天前認領。 未關閉
難度 2/5 1-3 小時 新手友好度 62/100
micropython/micropython-lib#762 ·
查看 micropython/micropython-lib 的全部 Issue
相似的 Issue
-
難度 2/5 1-3 小時 新手友好度 68/100
docling-project/docling-mcp#147 ·
-
難度 2/5 1-3 小時 新手友好度 80/100
維護者通常 1 天內回覆
-
enhancement
難度 2/5 1-3 小時 新手友好度 76/100
autowarefoundation/autoware_carla_scenario#405 ·
維護者通常 1 天內回覆
-
bug
難度 2/5 1-3 小時 新手友好度 79/100
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 78/100
mohitmishra786/readprism#322 ·
維護者通常 1 天內回覆