Reaping uses one HGET and one ack or requeue round trip for each expired task
維護者通常 1 天內回覆
還沒有人認領這個 Issue。
評估
- 難度
- 4/5
- 預估耗時
- 3-5 天
- 新手友好度
- 55/100
- Issue 類型
- 重構
- 描述清晰度
- 基本清楚
- 活躍度
- 活躍
研究方向
Start in threadmill/backends/redis.py at RedisBroker._reap_task and the claimed_ids loop, then inspect reaper.lua and related issue #71 for decision correctness. Trace the maintenance pass and ensure expiry batches avoid per-task HGET and sequential acknowledge/requeue round trips while preserving the existing reaping behavior.
由索引模型根據 Issue 內容生成。
描述
Found by the SuperJoe review of the lease-expiry retry patch (4ec9068..d5a1fdb).
reaper.lua claims a whole batch in one call. Then RedisBroker._reap_task uses two more round trips for each claimed task. The first is an HGET for the stored payload. The second is an acknowledge or requeue script call. All calls run one after the other in the maintenance pass of the broker:
# threadmill/backends/redis.py
claimed_ids = self._reaper_script(...)
for claimed_id in claimed_ids:
...
self._reap_task(task_id)
The replaced Lua reaper settled the whole batch in one call. An expiry batch now costs O(batch) client round trips. It also blocks the mover and reaper pass for every queue behind it. Reaping is an exception path, so the impact is small. But the cost is unbounded in batch_size.
The claim script can return the stored data of each claimed task with its ID. HGET already uses the same Redis instance and the script is atomic. That change halves the round trips. The decision can also run for each queue in one batch. Related: #71 covers the correctness of the decision, not its cost.
- 主要語言
- Python
- 星號
- 19
- 分支
- 1
- 平均合併
- 14 小時 37 分鐘
- 30 天內合併 PR
- 22
環境準備
- 沒有 Dockerfile 或 Docker Compose 檔案
- 沒有 Pull Request 範本
- 閱讀貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
codingjoe/threadmill 的其他 Issue
-
Add worker pool telemetry可能重新可做 @codingjoe 於 101 天前認領,目前沒有進行中的 PR。 未關閉enhancement
codingjoe/threadmill#18 · 已指派 1 人 ·
維護者通常 1 天內回覆
查看 codingjoe/threadmill 的全部 Issue
相似的 Issue
-
enhancement good first issue Stellar Wave trivial
難度 2/5 1-3 小時 新手友好度 75/100
StellarCanary/ProtocolCanary-Fixtures#258 ·
維護者通常 1 天內回覆
-
github_actions
難度 2/5 1-3 小時 新手友好度 65/100
Hochfrequenz/aibap.mcp#578 ·
維護者通常 1 天內回覆
-
bug
難度 2/5 1-3 小時 新手友好度 75/100
mishraprafful/multihull#150 ·
維護者通常 1 天內回覆
-
mp: /status reports the server class name as engine_type, not the configured engine可能已有人在做 關聯的 PR 仍在進行中或已合併。 未關閉
難度 2/5 1-3 小時 新手友好度 72/100
維護者通常 2 天內回覆
-
難度 2/5 1-3 小時 新手友好度 66/100
python-caldav/caldav#735 ·
維護者通常 1 天內回覆