fix(pipeline): reclaim pending entries after the live lease budget

This commit is contained in:
2026-11-15 23:47:51 +03:00
parent eb6d229afb
commit 442163b0f0
4 changed files with 8835 additions and 5 deletions
+4 -2
View File
@@ -315,7 +315,8 @@ def consume(slot):
context = multiprocessing.get_context("spawn")
cursor = "0-0"
timeout = integer("JOB_TIMEOUT_SECONDS", 20, 2, 117)
if integer("JOB_LEASE_SECONDS", 23, 3, 120) <= timeout:
lease = integer("JOB_LEASE_SECONDS", 23, 3, 120)
if lease <= timeout:
raise ValueError("Lease must exceed child timeout")
try:
while True:
@@ -329,7 +330,8 @@ def consume(slot):
STREAM,
GROUP,
consumer,
min_idle_time=3000,
# Do not steal an entry from a consumer inside its live budget.
min_idle_time=lease * 1000,
start_id=cursor,
count=1,
)