Repository navigation
feat(task-queue): rollback reconcile and verify gate - #592
Closed
aivong-openhands wants to merge 1 commit into
Closed
aivong-openhands wants to merge 1 commit into
aivong-openhands wants to merge 1 commit into
Conversation
Contributor
Coverage reportClick to see where and how coverage changed
This report was generated by python-coverage-comment-action |
||||||||||||||||||||||||
aivong-openhands
force-pushed
the
task-queue/06-watermarks
branch
from
September 30, 2026 06:14
e4a6197 to
abbcd35
Compare
aivong-openhands
force-pushed
the
task-queue/07-rollback
branch
from
September 30, 2026 06:14
0734c91 to
1f2efa5
Compare
aivong-openhands
force-pushed
the
task-queue/06-watermarks
branch
from
September 30, 2026 18:44
abbcd35 to
6fe75b7
Compare
aivong-openhands
force-pushed
the
task-queue/07-rollback
branch
2 times, most recently
from
September 30, 2026 19:00
57c8ea1 to
62f95a7
Compare
aivong-openhands
force-pushed
the
task-queue/06-watermarks
branch
from
September 30, 2026 20:55
a2b1c4d to
de589aa
Compare
aivong-openhands
force-pushed
the
task-queue/07-rollback
branch
from
September 30, 2026 20:55
62f95a7 to
5b7043d
Compare
python -m server.task_queue.rollback reconcile cancels every todo job of the scheduled tasks and fails every residual doing one, so no execution lock stays held; verify exits non-zero unless none remain (T1.10.2 steps 4 and 5). reconcile refuses while any worker heartbeat is fresh. retry_job_v2 accepts doing and failed jobs, so a sweep while a job or recovery pass can still retry re-queues work the sweep already cleared; the tests show that ordering leaving replayable work and the specified one not. OHE-3417 (Track 1, T1.10.2) Co-authored-by: openhands <openhands@all-hands.dev>
aivong-openhands
force-pushed
the
task-queue/06-watermarks
branch
from
September 30, 2026 21:59
de589aa to
3dceda5
Compare
aivong-openhands
force-pushed
the
task-queue/07-rollback
branch
from
September 30, 2026 21:59
5b7043d to
a902980
Compare
Contributor
Author
|
Closing: superseded by the revised CronJob migration plan for OHE-3417 (rev 16). The branch is kept for reference. reconcile (cancel_job_v1 / finish_job_v1 in one transaction under FOR UPDATE) and verify (the zero-rows gate) carry into the new rollback runbook with two changes. First, the 'refuse while any worker heartbeat is fresh' guard is replaced by 'worker permit closed and closed-set gate passed', because worker pods keep running sandbox lifecycle during rollback. Second, the task set becomes the full inventory, including the repair tasks. This comment was posted by an AI agent (OpenHands) on behalf of @aivong-openhands. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stack 7/7: OHE-3417 Track 1. Based on #591. Implements T1.10.2 steps 4 and 5. The chart counterpart is OpenHands/OpenHands-Cloud#1320 (T1.9).
Why
Queue tables keep work that runs the moment a worker returns, so switching workers off is not enough to roll back. Reconciliation must come after shutdown.
procrastinate_retry_job_v2matchesstatus IN ('doing','failed'), so a retry from a still-running job or from a recovery pass can re-queue work the sweep already cleared.Change
python -m server.task_queue.rollback:reconcilecancels everytodojob of the scheduled task names, including retries waiting onscheduled_at, and fails every residualdoingone, so no execution lock stays held. It uses Procrastinate's owncancel_job_v1(without abort) andfinish_job_v1, all in one transaction underFOR UPDATE. Other tasks are untouched.verifyis the zero-rows gate: it exits non-zero unless notodoordoingrow remains.Full rollback procedure (T1.10.2)
taskQueue.schedulingEnabled: false. Workers keep draining.doing, D = 5 min.rollback reconcile.rollback verify, which must exit 0.startingDeadlineSecondson the CronJobs, un-suspend them, and confirm the first occurrence fires.Tests
todojobs do not replay when a worker returns.Not in this stack
task_queue.outcomelog (outcome=executed), plus queue-age,failedanddoing-age queries.post_migrations (T1-8), after the rollback window closes.helm get valuesper env), PRE-3 (Cloud SQL, SaaS only), PRE-4 (pooler topology decides LISTEN/NOTIFY vs polling), PRE-5, and the per-job budgets / G from measured runtimes.This PR was created by an AI agent (OpenHands) on behalf of the user.
@aivong-openhands can click here to continue refining the PR
Enterprise server image for this PR: