Bound the batch acquire count because --prefetch-count is unbounded
Mantenedores costumam responder em até 1 dia
Ninguém assumiu esta issue ainda.
Avaliação
- Dificuldade
- 5/5
- Tempo estimado
- Mais de uma semana
- Facilidade para iniciantes
- 35/100
- Tipo de issue
- Funcionalidade
- Clareza
- Precisa de esclarecimento
- Status de atividade
- Ativa
- Stack de tecnologia
- python, redis
- Domínio
- backend, distributed-systems
Direção de pesquisa
Start with the --prefetch-count option, the worker's queue.Queue and acquire call, then trace RedisTaskBackend.acquire through acquire.lua and the README prefetching section. Confirm how the count reaches the queue and Redis script, and use the real redis-server reproduction described in the issue. Done requires a maintainer-selected ceiling to be consistently enforced and documented.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
Deferred from the task-prefetching review (crew run) rather than fixed in that branch, because choosing a ceiling is a maintainer decision.
What
count is unbounded end to end:
--prefetch-countaccepts any int>= 1(the only validation is the lower bound), defaulting to4 × threads- it becomes
queue.Queue(maxsize=count)andacquire(..., count=count)in the worker RedisTaskBackend.acquireforwards it asARGV[8], andacquire.luapops up to that many tasks inside one atomicEVAL
Why it matters
- one worker can lock the entire backlog under a single lease, starving every other worker until the shared deadline expires, at which point the reaper records the whole batch FAILED with no retry
- process memory grows with the number of buffered payloads
- the single-threaded Redis server is blocked for work proportional to
countper call (oneZPOPMIN/HGET/cjson/ZADD/HSETpass per task, inside one script execution)
Reproduced against a real redis-server: one call with ARGV[8]=6 moved all six ready tasks to the running set with an identical deadline and one worker id, leaving the ready set empty.
Options
- cap the effective count at a documented maximum (or at a new dedicated backend option)
- clamp
prefetch_countto the queue's backlog bound, if one exists - derive the ceiling from
lease_ttland the expected worst-case task duration, so a buffer cannot outlive its lease
Related: the buffer dwell counts against lease_ttl (the reserve happens at fetch time), so an unbounded buffer also makes false lease expiries more likely. That ceiling is documented in the branch's README section on prefetching.
- Linguagem predominante
- Python
- Estrelas
- 21
- Forks
- 2
- Merge médio
- 12h 53min
- PRs com merge (30d)
- 27
Preparar o ambiente
- Sem Dockerfile nem arquivo Docker Compose
- Sem modelo de pull request
- Ler o guia de contribuição
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Issues semelhantes
-
priority middle
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 62/100
KATO-Hiro/AtCoderClans#12940 ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 76/100
huggingface/huggingface_hub#5283 ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 78/100
Mantenedores costumam responder em até 1 dia
-
enhancement
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 86/100
ccxt/ccxt#31045 · 1 comentário ·
Mantenedores costumam responder em até 1 dia
-
bug example
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 86/100
Mantenedores costumam responder em até 1 dia