codingjoe / codingjoe/threadmill

WorkerProcess passes None poll intervals to the backend, breaking acquire in the consumer thread

Open
#53 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
12
Forks
1
Avg merge
1d 1h
Merged PRs (30d)
10

Description

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.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.