Hacktoberfest 2026: as issues que os mantenedores marcaram para outubro, abertas e boas para iniciantes. Ver issues do Hacktoberfest

Reaping uses one HGET and one ack or requeue round trip for each expired task

Fechada
#74 0 comentários 0 reações 0 responsáveis Ver no GitHub

Mantenedores costumam responder em até 1 dia

Ninguém assumiu esta issue ainda.

Avaliação

Dificuldade
4/5
Tempo estimado
3-5 dias
Facilidade para iniciantes
55/100
Tipo de issue
Refatoração
Clareza
Razoavelmente clara
Status de atividade
Ativa
Stack de tecnologia
lua, python, redis

Direção de pesquisa

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.

Escrita pelo modelo de indexação a partir do texto da issue.

Descrição

perf real

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.

Linguagem predominante
Python
Estrelas
19
Forks
1
Merge médio
14h 37min
PRs com merge (30d)
22

Preparar o ambiente

Primeiros passos

  1. Leia a issue inteira e depois o guia de contribuição do projeto.
  2. Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
  3. Faça um fork do repositório e trabalhe em uma branch.
  4. Abra um pull request que referencie o número da issue.

Mais de codingjoe/threadmill

Todas as issues de codingjoe/threadmill

Issues semelhantes

Mais issues de Python

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.