Hacktoberfest 2026: die Issues, die Maintainer für den Oktober markiert haben – offen und einsteigerfreundlich. Hacktoberfest-Issues durchsuchen

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

Geschlossen
#74 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

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
Refactoring
Klarheit
Größtenteils klar
Aktivitätsstatus
Aktiv
Tech-Stack
lua, python, redis

Rechercherichtung

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.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

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.

Vorherrschende Sprache
Python
Sterne
19
Forks
1
Ø Merge
14 Std. 39 Min.
Gemergte PRs (30 T.)
21

Entwicklungsumgebung

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus codingjoe/threadmill

Alle Issues in codingjoe/threadmill

Ähnliche Issues

Weitere Issues zu Python

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.