forked from mtusi2026/mtusi2026lab5
fix(pipeline): reclaim pending entries after the live lease budget
This commit is contained in:
+4
-2
@@ -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,
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user