Skip to content

[18.0][WIP] queue_job: run jobs in cron workers#871

Draft
sbidoul wants to merge 2 commits into
OCA:18.0from
acsone:18.0-cron-jobrunner-sbi
Draft

[18.0][WIP] queue_job: run jobs in cron workers#871
sbidoul wants to merge 2 commits into
OCA:18.0from
acsone:18.0-cron-jobrunner-sbi

Conversation

@sbidoul
Copy link
Copy Markdown
Member

@sbidoul sbidoul commented Jan 3, 2026

This very WIP and draft and I'm not even sure this is useful.

One benefit is simpler deployment when the time limit of job workers has to be greater than the small time limit of interactive workers. In that (common) case configur the cron worker time limit would be sufficient instead of deploying another Odoo instance with different worker limits.

It builds on the refactoring done in #866, in particular the _acquire_job function and job execution class methods.

The jobrunner still does the job scheduling (so with full support of channels etc), but /queue_job/runjob triggers crons which acquire jobs in ENQUEUED state and run them.

Look at the last commit to understand how this works, it's pretty simple.

@sbidoul sbidoul added this to the 18.0 milestone Jan 3, 2026
@OCA-git-bot
Copy link
Copy Markdown
Contributor

Hi @guewen,
some modules you are maintaining are being modified, check this out!

@sbidoul sbidoul force-pushed the 18.0-cron-jobrunner-sbi branch 2 times, most recently from f038a2a to 13d3aa9 Compare January 3, 2026 14:25
@sbidoul sbidoul force-pushed the 18.0-cron-jobrunner-sbi branch from 13d3aa9 to 3b6f3be Compare January 3, 2026 14:27
@sbidoul
Copy link
Copy Markdown
Member Author

sbidoul commented Jan 3, 2026

One thing I don't quite understand is why this can raise SerializationFailure.

SELECT uuid FROM queue_job WHERE state='enqueued' LIMIT 1 FOR UPDATE SKIP LOCKED

@sbidoul sbidoul force-pushed the 18.0-cron-jobrunner-sbi branch from 3b6f3be to f6108a7 Compare January 3, 2026 15:19
@github-actions
Copy link
Copy Markdown

There hasn't been any activity on this pull request in the past 4 months, so it has been marked as stale and it will be closed automatically if no further activity occurs in the next 30 days.
If you want this PR to never become stale, please ask a PSC member to apply the "no stale" label.

@github-actions github-actions Bot added the stale PR/Issue without recent activity, it'll be soon closed automatically. label May 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

stale PR/Issue without recent activity, it'll be soon closed automatically.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants