You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 6cdf287
Browse filesBrowse the repository at this point in the historyBrowse files
fix(run-engine,webapp): close gaps found in adversarial review of the pause sweep
Restore the TTL registration when returning a run. Admission removes the run's
member from the TTL sorted set, so returning it to the pending queue without
re-adding left a run that could never expire: on the next admission the dequeue
script takes its already-expired branch, which deliberately leaves cleanup to
the TTL consumer, and that consumer no longer has an entry to find. The per-run
expireRun job is not a backstop because it is only armed for development
environments.
Take the pause sweep out of the rollback window. It ran inside the try that
compensates a failed pause by clearing the DB flag, but by then the Redis limit
was already 0, so a sweep failure left the environment with no concurrency and
no paused flag — dark, and unrecoverable without a manual pause/resume cycle.
For the billing-limit path it also aborted the remaining environments in the
org. The pause is durable and the sweep is idempotent, so it now runs after the
pause has been committed and a failure is logged rather than propagated. That
also stops the queue pause reporting failure for a pause that took effect.
Retry passes while runs remain unclaimed. Admission is not atomic with the push
onto the worker queue: the dequeue script claims the concurrency slot and a
separate round trip does the RPUSH. A run caught in that gap fails the claim and
would previously have been abandoned, then executed during the pause.
Claim from both the resolver-mapped and the raw worker queue key. The trigger-
time fast path pushes to the raw workerQueue on the message while the master
queue consumer pushes to the resolver-mapped one, so with a region override
active the two producers disagree and a single-key LREM missed fast-pathed runs.
Batch the sweep. It read every payload in one MGET and then made one sequential
round trip per run, on a request path, with no error isolation — one failure
abandoned the remaining runs.
Tests: cover the LREM claim directly by emptying the worker queue without
marking the run dequeued (the previous test was excluded by the candidate set
before ever reaching the script), the TTL round trip, and the concurrency key
running counter across a return.
0 commit comments