A stored payload that does not deserialize keeps the reaper in a loop
Maintainer antworten meist innerhalb von 1 Tag
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Anfängerfreundlichkeit
- 55/100
- Issue-Typ
- Bug
- Klarheit
- Klar beschrieben
- Aktivitätsstatus
- Aktiv
- Bereich
- backend, distributed-systems
Rechercherichtung
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 undeserializable task is finalized as FAILED, publishes a result, and is not re-claimed indefinitely.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
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_TTLand the same error occurs. - The task never reaches
FAILEDand 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.
- Vorherrschende Sprache
- Python
- Sterne
- 19
- Forks
- 1
- Ø Merge
- 9 Std. 46 Min.
- Gemergte PRs (30 T.)
- 17
Entwicklungsumgebung
- Kein Dockerfile und keine Docker-Compose-Datei
- Keine Pull-Request-Vorlage
- Beitragsleitfaden lesen
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus codingjoe/threadmill
-
bug real side quest
Schwierigkeit 5/5 Über eine Woche Anfängerfreundlichkeit 35/100
codingjoe/threadmill#78 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag
-
perf real
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 55/100
codingjoe/threadmill#74 ·
Maintainer antworten meist innerhalb von 1 Tag
-
bug real
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 45/100
codingjoe/threadmill#75 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag
-
bug real
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 64/100
codingjoe/threadmill#71 ·
Maintainer antworten meist innerhalb von 1 Tag
-
perf real
Schwierigkeit 5/5 Über eine Woche Anfängerfreundlichkeit 35/100
codingjoe/threadmill#67 ·
Maintainer antworten meist innerhalb von 1 Tag
Alle Issues in codingjoe/threadmill
Ähnliche Issues
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 68/100
-
Task
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 65/100
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 86/100
war-and-code/dircue#200 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 87/100
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 84/100
Maintainer antworten meist innerhalb von 1 Tag