queue icon indicating copy to clipboard operation
queue copied to clipboard

[14.0] queue_job_cron_jobrunner: avoid concurrent access on ir.cron

Open petrus-v opened this issue 2 years ago • 6 comments

As odoo add a lock while running cron task we should only try to write on it. If the cron is running while create new queue job records we will wait next call.

petrus-v avatar Dec 19 '23 17:12 petrus-v

@ivantodorovich did you get similar issue on your odoo instances ?

petrus-v avatar Dec 19 '23 17:12 petrus-v

@ivantodorovich did you get similar issue on your odoo instances ?

Hey @petrus-v , @damdam-s 👋🏻 it's nice to see your names here

Actually, I originally developed this module for Odoo 15.0, relying on cron triggers. It was later backported to 14.0 by @chrisb-c01 (https://github.com/OCA/queue/pull/479). Instead of using cron triggers, it uses this nextcall field.

I've never used this module in 14.0, though 😓

ivantodorovich avatar Dec 19 '23 17:12 ivantodorovich

@ivantodorovich did you get similar issue on your odoo instances ?

Hey @petrus-v , @damdam-s 👋🏻 it's nice to see your names here

Actually, I originally developed this module for Odoo 15.0, relying on cron triggers. It was later backported to 14.0 by @chrisb-c01 (#479). Instead of using cron triggers, it uses this nextcall field.

I've never used this module in 14.0, though 😓

Thanks for your prompt reply, history regarding this topic and review !

Always a pleasure to see your name on so many projects around ! see you soon and happy end of year :)

petrus-v avatar Dec 19 '23 20:12 petrus-v

This PR has the approved label and has been created more than 5 days ago. It should therefore be ready to merge by a maintainer (or a PSC member if the concerned addon has no declared maintainer). 🤖

OCA-git-bot avatar Dec 24 '23 18:12 OCA-git-bot

are you aware of https://github.com/OCA/queue/pull/612?

gurneyalex avatar Jan 08 '24 10:01 gurneyalex

are you aware of #612?

no I'm not... but I'm not sure how much it's related. As mentionned by @ivantodorovich this module in version 14.0 do not rely on ir.cron.trigger which exists from version 15.0.

So creating a new job in this version try to write on the ir.cron which is probably running to the row is lock, at the end the whole transaction get rollback before this PR.

petrus-v avatar Jan 08 '24 13:01 petrus-v

What a great day to merge this nice PR. Let's do it! Prepared branch 14.0-ocabot-merge-pr-611-by-guewen-bump-patch, awaiting test results.

OCA-git-bot avatar Apr 04 '24 06:04 OCA-git-bot

Congratulations, your PR was merged at 34e80c7bf6f14039ce63e6d3395308c3fb0e6d98. Thanks a lot for contributing to OCA. ❤️

OCA-git-bot avatar Apr 04 '24 06:04 OCA-git-bot