Skip to content

Syncing from upstream OCA/queue (19.0)#521

Merged
bt-admin merged 15 commits intobrain-tec:19.0from
OCA:19.0
Jan 9, 2026
Merged

Syncing from upstream OCA/queue (19.0)#521
bt-admin merged 15 commits intobrain-tec:19.0from
OCA:19.0

Conversation

@bt-admin
Copy link

@bt-admin bt-admin commented Jan 9, 2026

bt_gitbot

sbidoul and others added 15 commits January 4, 2026 12:41
The automatic dead jobs requeuer now works out of the box.
This allows creating test job with a long duration for stress testing.
When a SerializationFailure occurs when updating the state of dependent
jobs, the cursor is not usable anymore so the retry failed with `current transaction is aborted`. A savepoint fixes that.
In this commit we cleanly separate the job acquisition (i.e. verifying the job is in the exepected state, marking it started and locking it) from job execution.

We also avoid trying to start the job if it is already locked by using SKIP LOCKED
and exiting early. Indeed in such situations the job is likely already being handled by another worker so there is no point trying to start it, so we exit early
and let it be handled either by the other worker or the dead job requeuer.
Extract the logic to run one job out of the /queue_job/runjob route.
Towards making this logic reusable in other job executors.
Since we are not going to delete records nor modify foreign keys,
we can take a weaker lock.
Signed-off-by sbidoul
@bt-admin bt-admin added the 19.0 label Jan 9, 2026
@bt-admin bt-admin merged commit 32ee886 into brain-tec:19.0 Jan 9, 2026
4 checks passed
@codecov
Copy link

codecov bot commented Jan 9, 2026

Codecov Report

❌ Patch coverage is 82.44275% with 23 lines in your changes missing coverage. Please review.
✅ Project coverage is 82.55%. Comparing base (1f23acd) to head (d2a8e90).
⚠️ Report is 17 commits behind head on 19.0.

Files with missing lines Patch % Lines
queue_job/controllers/main.py 47.50% 20 Missing and 1 partial ⚠️
queue_job/models/queue_job.py 84.61% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             19.0     #521      +/-   ##
==========================================
+ Coverage   82.14%   82.55%   +0.41%     
==========================================
  Files          51       52       +1     
  Lines        4083     4179      +96     
  Branches      365      371       +6     
==========================================
+ Hits         3354     3450      +96     
- Misses        659      660       +1     
+ Partials       70       69       -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants