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

A stored payload that does not deserialize keeps the reaper in a loop

Aberta
#73 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
Bug
Clareza
Claramente especificada
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 compare its deserialization failure path with the replaced Lua reaper's finalize step. Trace the raw JSON fields and verify that an unde­serializable task is finalized as FAILED, publishes a result, and is not re-claimed indefinitely.

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

Descrição

bug real

Found by the SuperJoe review of the lease-expiry retry patch (4ec9068..d5a1fdb).

RedisBroker._reap_task deserializes the stored task before it decides the fate of the task:

# threadmill/backends/redis.py
data = self.backend.client.hget(task_key, "data")
if data is None:
    logger.warning("Claimed task %r has no task data; skipping", task_id)
    return
task_result = self.backend.deserialize_task_result(data)

deserialize_task_result imports the task and its retry callback from the serialized dotted paths. A deployment can remove or rename the callback while the task waits in the queue. Then the import fails and the call raises on every pass. The surrounding logger.exception only writes a log record. The claim stays:

  • The reaper claims the task again every CLAIM_TTL and the same error occurs.
  • The task never reaches FAILED and never publishes a result.
  • Only expiry of the task hash or a late acknowledgement removes the running entry.

The replaced Lua reaper decoded the same payload with cjson and finalized it as FAILED without any import. This error is a regression from that rewrite.

Suggested correction: add a salvage branch to the reap path. The branch finalizes a payload that the code cannot deserialize. The raw JSON already carries status, errors, and the task fields. Patch it and publish it as FAILED. A small Lua script that copies the finalize step of the old reaper can do this. Then the behavior matches the pre-rewrite state and the retry decision does not return to Lua.

Linguagem predominante
Python
Estrelas
19
Forks
1
Merge médio
2h 31min
PRs com merge (30d)
16

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.