codingjoe / codingjoe/threadmill
WorkerProcess passes None poll intervals to the backend, breaking acquire in the consumer thread
- 主要语言
- Python
- 星标
- 12
- 派生
- 1
- 平均合并
- 1 天 1 小时
- 30 天内合并 PR
- 10
描述
Found by `testJoe` while adding coverage for the fair multi-queue rotation (`codingjoe-fair-multi-queue-scheduling`), and confirmed pre-existing (untouched by that diff):
`defer: WorkerProcess.run() lets None poll overrides reach RedisTaskBackend.acquire, raising TypeError in the consumer thread. Pre-existing, untouched L297. [tests/test_executor.py]`
## QED
1. `tests/test_executor.py:_make_worker()` defaults `poll_interval` and `poll_max_interval` to `None` and passes them into `WorkerProcess`.
2. `WorkerProcess.run()` assigns them to the backend (`backend.poll_interval = self.poll_interval`), so the backend's poll options become `None`.
3. `RedisTaskBackend.acquire()` computes `int(self.poll_max_interval / self.poll_interval)`, which raises `TypeError: unsupported operand type(s)` inside the consumer thread.
The suite only reports `PytestUnhandledThreadExceptionWarning`, so the failure is invisible today. Either treat `None` as "keep the backend default" in `WorkerProcess`, or make the test helper pass the real defaults.
贡献指南
调研方向
从 tests/test_executor.py:_make_worker() 和 WorkerProcess.run() 开始,然后检查使用轮询间隔的 RedisTaskBackend.acquire()。运行相关的 executor 测试,并确认默认轮询不再以 None 的形式到达 acquire,且 consumer thread 能够在没有未处理的 TypeError 的情况下完成。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- python, redis
- 领域
- backend, databases, testing-qa
- Issue 类型
- 缺陷
- 难度
- 2/5
- 预计耗时
- 1-3 小时
- 活跃度
- 活跃
- 描述清晰度
- 描述清楚
- 新手友好度
- 82/100