Repository navigation
Find aged running jobs and read get_job from one snapshot (0.6) - #603
Conversation
Backport of #600. Claims and leases record the aged effective priority while the ready row keeps the lane priority; load_job, load_active_lease_in_tx and callback_job_in_tx joined the two on priority, so with priority aging on a job that had aged before its claim could not be found by callback or read back as running. Match the attempt by job_id and run_lease instead, and read load_job's relations from one REPEATABLE READ, READ ONLY snapshot.
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the
|
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
…-xza211-aged-lease-06 # Conflicts: # CHANGELOG.md # awa/tests/queue_storage_runtime_test.rs
The admin current-jobs, recent-jobs and kind-count CTEs, the job-id candidates behind list_jobs and the unique-key cancel lookup joined a materialized lease to its ready row on priority. A lease records the aged effective priority, so a job that aged before its claim was missing from the job list and kinds page and was not found by cancel_by_unique_key. Match the attempt by job_id and run_lease instead, and add a regression test.
Backport of #600 to the 0.6 line. Rust only: no migration, no schema patch, no public API change.
The bug on 0.6.11
Claims and leases record a job's aged effective priority; its ready row keeps the lane priority. Three reads joined them on
ready.priority = lease.priority:load_job(get_job, admin job detail, lifecycle events)callback_job_in_txload_active_lease_in_txPriority aging is on by default (every 60 s), so any job that waited more than a minute at priority 2–4 before its claim is affected. The joins now match the attempt (
job_idandrun_lease + 1), which the substrate already relies on.load_jobalso reads its seven relations in oneREPEATABLE READ, READ ONLYtransaction, so a job moving between two of them during the read can't come back missing.The two remaining
ready.priority = claims.priorityjoins on this branch are claim-cursor probes, which compare lane priorities and are correct.Tests (local, PG16)
queue_storage.rs(wrongload_jobstate for a materialized lease, no callback match for a receipt claim) and pass with the fix.queue_storage_runtime_test129/129,cel_callback_test19,external_wait_test38,lifecycle_hook_test18.cargo fmt --checkandclippy -D warningsonawa-modelare clean.CHANGELOG has the entry under Unreleased.
Generated by Claude Code