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 小时 39 分钟
- 30 天内合并 PR
- 21
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
codingjoe/threadmill 的其他 Issue
-
Add worker pool telemetry可能重新可做 @codingjoe 于 100 天前认领,目前没有进行中的 PR。 未关闭enhancement
codingjoe/threadmill#18 · 已指派 1 人 ·
维护者通常 1 天内回复
查看 codingjoe/threadmill 的全部 Issue
相似的 Issue
-
first
难度 2/5 1-3 小时 新手友好度 72/100
AcademySoftwareFoundation/rmtc#54 · 1 条评论 ·
-
feature/cohorts feature/feature-flags team/feature-flags
难度 2/5 1-3 小时 新手友好度 74/100
维护者通常 1 天内回复
-
License examples/ as MIT可能已有人在做 @PGrayCS 今天认领。 未关闭documentation enhancement example good first issue
难度 2/5 1-3 小时 新手友好度 84/100
speedyk-005/yasbd-lib#383 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 68/100
interactions-py/interactions.py#1827 ·
-
Managed start can fail when OpenVMM reads its control capability before NVX writes it可能已有人在做 @ppenna 今天认领。 未关闭bug
难度 2/5 1-3 小时 新手友好度 76/100
维护者通常 1 天内回复