Repository navigation
Keep runner jobs in step with the runner: one claim, delivered cancellations, requeued lost hand-outs - #29
Conversation
PR Summary by QodoPrevent duplicate runner claims and recover lost job hand-outs
AI Description
Merge Risk
|
|
🤖 Finished Review · ✅ Success · Started 10:37 PM UTC · Completed 10:50 PM UTC Commit: Runtime: pi · Model: sonnet → claude-sonnet-5-5 · Effort: high · Cost: $3.32 |
Code Review by Qodo
1.
|
|
Risk Assessment: moderate (2/5) DetailsModerate risk preserved: substantial diff size and change coupling across Actions runner dispatch logic remain balanced by zero protected or security-sensitive paths, no dependency or CI changes, solid test coverage, and stable author history across incremental updates. Previous runRisk Assessment: moderate (2/5) DetailsModerate risk: substantial diff size and change coupling across Actions runner dispatch logic are balanced by zero protected or security-sensitive paths, no dependency or CI changes, solid test coverage, and single-author stability. Previous run (2)Risk Assessment: moderate (2/5) DetailsModerate risk: substantial diff size and change coupling across Actions runner dispatch logic are balanced by zero protected or security-sensitive paths, no dependency or CI changes, solid test coverage, and single-author stability. Previous run (3)Risk Assessment: moderate (2/5) DetailsModerate risk: substantial diff size and change coupling across Actions runner dispatch logic are balanced by zero protected or security-sensitive paths, no dependency or CI changes, solid test coverage, and single-author stability. Previous run (4)Risk Assessment: moderate (2/5) DetailsModerate risk: substantial diff size and change coupling across Actions runner dispatch logic are balanced by zero protected or security-sensitive paths, no dependency or CI changes, solid test coverage, and single-author stability. Previous run (5)Risk Assessment: moderate (2/5) DetailsModerate risk: substantial diff size and change coupling across Actions runner dispatch logic are balanced by zero protected or security-sensitive paths, no dependency or CI changes, solid test coverage, and single-author stability. Previous run (6)Risk Assessment: moderate (2/5) DetailsModerate risk: substantial diff size and change coupling across Actions runner dispatch logic are balanced by zero protected or security-sensitive paths, no dependency or CI changes, solid test coverage, and single-author stability. |
ReviewFindingsMedium
Low
Earlier findings
Next steps:
4 finding(s) below the Previous run<!-- fullsend:review-findings-v2:eyJ2ZXJzaW9uIjoyLCJhY3Rpb24iOiJyZXF1ZXN0LWNoYW5nZXMiLCJma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yJpZCI6ImZfNGVlYWQ5YTZhNmMyYTEzMSIsInN0YXR1cyI6InJlc29sdmVkX2J5X2NoYW5nZSJ9LHsiaWQiOiJmXzI0MzQ3NzFhZmQ3OTVkZTMiLCJzdGF0dXMiOiJyZXNvbHZlZF9ieV9jaGFuZ2UifSx7ImlkIjoiZl9mNTg5NTE1ZDkzZTMwNmU0Iiwic3RhdHVzIjoicmVzb2x2ZWRfYnlfY2hhbmdlIn0seyJpZCI6ImZfNjdjMGM1ODM2ZDBiNzcxNSIsInN0YXR1cyI6InJlc29sdmVkX2J5X2NoYW5nZSJ9LHsiaWQiOiJmX2I2YmZlY2VlY2ZjNDk5ODciLCJzdGF0dXMiOiJyZXNvbHZlZF9ieV9jaGFuZ2UifSx7ImlkIjoiZl9mNTc4ZjI1YmQwZjE2NmU1Iiwic3RhdHVzIjoicmVzb2x2ZWRfYnlfY2hhbmdlIn0seyJpZCI6ImZfNzQzZTU4ZmZiN2I2ZTc2OSIsInN0YXR1cyI6InJlc29sdmVkX2J5X2NoYW5nZSJ9LHsiaWQiOiJmXzQzZTA4YjJiNjRkMmYwZjMiLCJzdGF0dXMiOiJyZXNvbHZlZF9ieV9jaGFuZ2UifSx7ImlkIjoiZl80ODc4Y2RkYTNjM2EzNjAxIiwic3RhdHVzIjoicmVzb2x2ZWRfYnlfY2hhbmdlIn1dfQ== --> ReviewFindingsMedium
Low
Next steps:
|
|
🤖 Finished Review · ✅ Success · Started 11:17 PM UTC · Completed 11:37 PM UTC Commit: Runtime: pi · Model: sonnet → claude-sonnet-5-5 · Effort: high · Cost: $3.62 |
af18d34 to
0fbcaea
Compare
|
🤖 Finished Review · ✅ Success · Started 11:42 PM UTC · Completed 12:02 AM UTC Commit: Runtime: pi · Model: sonnet → claude-sonnet-5-5 · Effort: high · Cost: $4.28 |
|
🤖 Finished Review · ✅ Success · Started 1:21 AM UTC · Completed 1:39 AM UTC Commit: Runtime: pi · Model: sonnet → claude-sonnet-5-5 · Effort: high · Cost: $4.89 |
jctanner
left a comment
There was a problem hiding this comment.
Requesting changes — the mechanisms are real and well tested (the squad verified the atomic claim, the cancellation redelivery, the conditional completion, and the delete-detach), but two race windows remain that re-open exactly the class this PR closes:
- A cancellation can be lost while an
Onlinepoll settles. In_settle_idle_runner, a cancellation that commits between the held-job read and the in-progress-jobs query (which filtersstatus="in_progress"and so misses the now-completed cancelled job) results in the hold being popped and the runner marked idle;_pending_cancellationthen sees an idle runner and returns nothing — the worker is never told to stop. Re-read the held job's conclusion before clearing the hold (and serialize that decision with cancellation writes), plus the interleaving test the bot sketched. - Poll generations are assigned after the initial awaits (token lookup, session select, heartbeat commit), so an older abandoned request delayed in those awaits can take a higher generation than a newer live poll and supersede it. Capture a monotonically increasing arrival sequence synchronously at handler entry and register the poll with it; add the reversed-initialization-order test.
- (Codex)
_complete_jobdoesn't revalidate job ownership after waiting on the runner lock — a report that waited on the lock can complete a job the runner no longer holds. Re-check the hold/ownership after the lock wait.
Also worth folding in: the pre-existing unauthenticated pipelines deregister is amplified byfail_live_jobs=True(#44's own-token requirement fixes it — coordinate), the docs misattribute the pool long-poll toactions_pipelines.py, and themain.py/alembicrefactors are scope creep the bot already noted.
352fc40 to
d22851c
Compare
|
Thanks, James. Rebased onto main at 3f31565 (with #30 and #31). #31's
|
|
🤖 Finished Review · ✅ Success · Started 5:42 PM UTC · Completed 5:58 PM UTC Commit: Runtime: pi · Model: sonnet → claude-sonnet-5-5 · Effort: high · Cost: $3.70 |
GitHub assigns each job to exactly one runner. Both of the emulator's claim paths, the emulator runner's poll (_poll_for_jobs) and the upstream runner's message poll (_claim_next_job), read the queued jobs and then wrote the assignment unconditionally. Two polls in separate sessions could both read a job as queued and both claim it, so the job ran twice. With four site-wide emulator runners and eight concurrent runs, five of 32 jobs ran on two runners each. With two upstream runners, both ran job request 1. The claim is now a conditional UPDATE on status = 'queued'. Only the poll whose update changes the row owns the job and marks its runner busy. A poll that loses moves on to the next matching job, or returns no job. The upstream runner that lost the job got a bare 404 on every lock renewal. The runner retries that, so it kept renewing and never took another job. It gives a job up only on TaskAgentJobNotFoundException, so accepting, renewing or completing a job request the runner does not hold now returns a 404 with that exception body. Assisted-by: Claude Signed-off-by: Wayne Sun <gsun@redhat.com>
A job request a runner does not hold answered {"detail": "Job request not
found"} before, and now the wrapped TaskAgentJobNotFoundException the
runner reads. The wrapped body keeps that detail field too, for clients
that read it.
Assisted-by: Claude
Signed-off-by: Wayne Sun <gsun@redhat.com>
Startup imports app.main, which sets up the github_emulator logger, then runs the Alembic migrations. alembic/env.py applied alembic.ini's logging with fileConfig, whose default disables every logger that already exists, so the app's own lines stopped after startup. In the test suite, any migration test that ran after app.main was imported did the same, which left the startup-logging tests with an empty capture in CI. env.py now applies alembic.ini's logging only on the command line (the app sets configure_logger to False) and never disables existing loggers. Assisted-by: Claude Signed-off-by: Wayne Sun <gsun@redhat.com>
- A poll replaced while it claimed a job gave that job to a request the runner no longer reads. The poll checks again after the claim, gives the job back and frees the runner. - A report of a job's end checked for a cancellation on the job it loaded before it took the runner's lock, so a cancellation committed meanwhile was overwritten. The write is now conditional on the stored row. - A late Online poll freed a runner whose held job was deleted before the cancellation went out. Settling now keeps the runner busy until the runner acknowledges that cancellation. Assisted-by: Claude Signed-off-by: Wayne Sun <gsun@redhat.com>
- An Online poll that settles a busy runner read the held job, then listed the runner's in-progress jobs. A cancellation committing in between hid the job from the list, so the poll dropped the hold and freed the runner, and the cancellation was never sent. The runner is now freed by one conditional UPDATE that re-reads the held job's conclusion; a cancelled or deleted job keeps it busy, and the cancellation goes out on that poll. The cancellation writers run in other requests' transactions and do not take the runner's lock, so the decision is serialised in the database. - A poll's generation was taken after its token lookup, session read and heartbeat commit, so an older poll delayed there could outrank a newer live one and take its job. The generation is now the poll's arrival number, taken before its first await; a poll that registers after a newer one keeps the newer one's generation and returns 204. - A job report checked ownership before waiting on the runner's lock. A requeue under the lock could leave it completing a job the runner no longer held. _report_job_end now re-reads the job's runner once it holds the lock and changes nothing when it moved; the pool routes answer TaskAgentJobNotFoundException, the legacy route 404. Each case has a test in test_runner_broker_races.py that fails on the previous head. Assisted-by: Claude Signed-off-by: Wayne Sun <gsun@redhat.com>
Review asked to keep app/main.py and alembic to this branch's fixes. The branch has to touch app/main.py (the admin password out of the startup log, a handler and a GITHUB_EMULATOR_LOG_LEVEL fallback for the app's loggers), and since #30 the hygiene check runs ruff on every file a change touches. So app/main.py keeps ruff's import order (I001), and its two try/except-pass blocks go back to main's shape with a noqa for S110 instead of the contextlib.suppress rewrite. alembic/env.py, migrations.py and tests/test_startup_logging.py get ruff's import order for the same reason; their logging fix is unchanged. Assisted-by: Claude Signed-off-by: Wayne Sun <gsun@redhat.com>
The note called it the pool long-poll. The fix was in the custom runner's job long-poll, _poll_for_jobs in actions_dispatch.py; the distributedtask message poll is dt_get_messages in actions_distributed_task.py. Assisted-by: Claude Signed-off-by: Wayne Sun <gsun@redhat.com>
#34's plan-events route completed only a job still in progress. A job cancelled while it ran is already completed, so its JobCompleted event returned early and its runner stayed busy for good. A cancelled job now reaches _complete_job too, which keeps the cancelled conclusion and frees the runner; its outputs are left unchanged. A queued job, or a job completed otherwise, still returns early. The report goes through _report_job_end, so it runs under the runner's lock and leaves a job that moved off the runner as it is, as the other report routes do. Test: test_job_completed_for_a_cancelled_job_frees_the_runner, from the combined validation branch. Assisted-by: Claude Signed-off-by: Wayne Sun <gsun@redhat.com>
d22851c to
11d6f3b
Compare
|
Rebased onto main at 69c2a2b, which now has #27, #34, #36 and #38. #31's and #34's checks on the job-server routes are unchanged. |
|
🤖 Finished Review · ✅ Success · Started 6:27 PM UTC · Completed 6:46 PM UTC Commit: Runtime: pi · Model: sonnet → claude-sonnet-5-5 · Effort: high · Cost: $4.73 |
dt_raise_plan_event set job.outputs before it took the runner's lock. If the job was requeued or cancelled while the event waited, the ownership check's autoflush (or _complete_job's flush) still wrote the outputs. The outputs now go into _complete_job's conditional UPDATE, so a rejected or cancelled report leaves them as they were. Assisted-by: Claude Signed-off-by: Wayne Sun <gsun@redhat.com>
_poll_for_jobs expires the session between passes, which expired the runner too. A job queued during the long poll then failed the claim with MissingGreenlet when _claim_queued_job read runner.id. Refresh the runner after the wait, inside the next pass's read. Assisted-by: Claude Signed-off-by: Wayne Sun <gsun@redhat.com>
|
🤖 Finished Review · ✅ Success · Started 7:13 PM UTC · Completed 7:28 PM UTC Commit: Runtime: pi · Model: sonnet → claude-sonnet-5-5 · Effort: high · Cost: $3.06 |
repos.py: sorted imports, an unused Optional import and an unused Response; the same fixes as on #29. Assisted-by: Claude Signed-off-by: Wayne Sun <gsun@redhat.com>
There was a problem hiding this comment.
Note: The following review comments could not be posted on the diff (GitHub returned 422) and are included here instead:
src/app/api/actions_pipelines.py(file-level): Line 184 ·
[low] auth-bypass
The repository pipelines deletion lookup validates runner_id only. Neither owner nor repo is resolved or compared with the runner's repository, so even a fabricated repository path can delete a runner belonging to another repository or enterprise.
Suggested fix: Resolve owner/repo, constrain the runner lookup by repository ID, and independently authorize the caller to delete that target.
src/app/main.py(file-level): Line 176 ·
[low] scope-creep
Cosmetic sorting and reordering of middleware and REST API router imports in create_app() expands the diff without contributing to runner lifecycle defect remediation (the PR body acknowledges it as ruff import sorting).
Suggested fix: Revert the cosmetic import reordering or move it into a project-wide formatting sweep.
jctanner
left a comment
There was a problem hiding this comment.
Re-verified at 20a9861 — all three races fixed: poll generations now come from a monotonic arrival counter taken before the first await; _settle_idle_runner tracks the watched job and re-checks its cancellation (_free_runner_unless_cancelled) before freeing the runner; _complete_job revalidates via _runner_moved_on after the lock wait. Approving.
jctanner
left a comment
There was a problem hiding this comment.
Re-verified at 20a9861 — all three races fixed: poll generations now come from a monotonic arrival counter taken before the first await; _settle_idle_runner tracks the watched job and re-checks its cancellation (_free_runner_unless_cancelled) before freeing the runner; _complete_job revalidates via _runner_moved_on after the lock wait. Approving.
jctanner
left a comment
There was a problem hiding this comment.
Re-verified at 20a9861 — all three races fixed: poll generations from a monotonic arrival counter before the first await; the watched job's cancellation re-checked (_free_runner_unless_cancelled) before freeing; _complete_job revalidates via _runner_moved_on after the lock wait. Approving.
repos.py: sorted imports, an unused Optional import and an unused Response; the same fixes as on #29. Assisted-by: Claude Signed-off-by: Wayne Sun <gsun@redhat.com>
Part of #39
Runner lifecycle: one claim per job, cancellations that reach the runner, no lost hand-outs
What this fixes
On GitHub, a job runs on exactly one runner, a cancelled job stops on its runner, and a job handed to a runner either reaches it or goes back to the queue. With several
actions/runnerrunners on the emulator, none of these held:concurrency: cancel-in-progressor a run cancel marked the job cancelled in the database only. The runner ran it to the end, so a superseded stage ran twice. The runner's final report then overwrotecancelledactions/runnerabandons its message poll whenever its status changes. The emulator kept serving the abandoned request, which could still claim a job and answer it to nobody. The job then hung in progress, or failed with every step queued. A runner whose first poll timed out under load hit the same case_poll_for_jobs) also held one read transaction across all its passesChanges
All in
src/app/api/actions_distributed_task.pyunless noted._poll_for_jobsinactions_dispatch.py,_claim_next_job) go through_claim_queued_job:UPDATE ... WHERE id = :id AND status = 'queued'. Only the poll that changes the row owns the job. Accepting, renewing or completing a job request the runner does not hold answers 404 with aTaskAgentJobNotFoundExceptionbody, which makes the runner give the job up.JobCancellationmessage ({"jobId", "timeout"}) for a busy runner whose job was cancelled._complete_jobkeeps acancelledconclusion and still frees the runner.JobCancellation. A runner that polls asOnlinewhile held busy is freed, and its lost job fails. The first 2 minutes after a hand-out are exempt.DELETEof the message) nor named aslastMessageIdgoes back to the queue. The same holds for a poll with nolastMessageIdwhile the job has not started a step.UPDATE, so a report that commits first wins.github_emulator.runner_broker.app.maingives thegithub_emulatorloggers a handler (GITHUB_EMULATOR_LOG_LEVEL, defaultINFO)._delete_runner_and_detach_history, as the admin route does. The custom runner's long-poll (_poll_for_jobsinactions_dispatch.py) commits before each wait.Lint: the touched files meet the ruff rules. Imports move to the top of
actions_distributed_task.py, an unused import and two unused assignments are removed, andmain.pyimports are sorted. No behaviour changes there.Ledger: one
docs/bugs/fixed/entry per fix, each listed inPLAN.md.Tests
maintests/actions/test_job_claim_race.py(3)typeKeytests/actions/test_runner_job_cancellation.py(3)JobCancellationper cancelled job; none for a running job; the report keepscancelledand frees the runnertests/actions/test_runner_orphaned_jobs.py(4)Onlinefrees a held runner;Busyand a fresh hand-out are left alone_holding) existstests/actions/test_runner_cancel_delivery.py(3)_holding) existstests/actions/test_runner_lost_handout.py(4)tests/actions/test_execution.py::test_pool_distributed_task_protocol_flowtests/actions/test_runner_broker_races.py(7)Onlinepoll keeps the cancellation; a superseded poll hands out nothing; a runner an older poll made busy gets no second job; acknowledgements and reports wait for the runner's lock; acknowledgements are kept per runnertests/actions/test_runner_self_delete.py(1)tests/test_startup_logging.py(2)INFOEach fails or errors on the code before its fix. Full suite: runs in this pull request's CI (
ci.yml).test_a_newer_poll_replaces_an_older_one_before_it_can_claimcan fail once on a loaded machine: the test database's 0.1 s lock timeout answers the older poll with 503. It passes on rerun. The production lock timeout is far longer.Effect on existing behaviour
JobCancellation({"jobId", "timeout"}, the messageactions/runnerreads), sent only for a busy runner's cancelled or deleted job, and again on each poll until the runner deletes the message or reports the job's end.TaskAgentJobNotFoundExceptionbody; it keeps the earlierdetailfield.Onlinewhile held busy for over 2 minutes is freed, and its job fails. Before, it stayed busy.lastMessageIdgoes back to the queue (not before 5 s after the hand-out). Before, it hung or failed.INFOlines in the server log (github_emulator.runner_broker). SetGITHUB_EMULATOR_LOG_LEVEL=WARNINGto quiet them; an unknown level falls back toINFO. The first-start line names the admin account, never its password.runner_namestays on them. A runner removing itself mid-job is removed and the job fails; the admin route still refuses a runner that is running a job.Known limits
JobCompleted, or the job request's finish). There is no server-side abandonment timeout yet.Follow-up with the upstream-runner protocol PR
That PR adds the
plans/{planId}/eventsroute, which completes the job fromJobCompletedfrom plan version 8. Whichever of the two merges second must let that route free the runner of a cancelled job. The guard isif job.status != "completed" or job.conclusion == "cancelled":before_complete_job. Without it, a cancelled job's runner stays busy after its report on plan version 8. This PR alone needs no change there: onmainthe job-request finish route always calls_complete_job.