Skip to content

Conversation

@petrus-v
Copy link
Contributor

@petrus-v petrus-v commented Dec 19, 2023

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 petrus-v changed the base branch from 16.0 to 14.0 December 19, 2023 17:07
@petrus-v petrus-v force-pushed the 14.0-foodles-queue_job_cron_jobrunner-20231219 branch from cd8cbda to 993e6bb Compare December 19, 2023 17:09
@petrus-v petrus-v changed the title 14.0 foodles queue job cron jobrunner 20231219 [14.0] foodles_queue_job_cron_jobrunner: avoid concurrent access on ir.cron Dec 19, 2023
@petrus-v
Copy link
Contributor Author

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

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 petrus-v force-pushed the 14.0-foodles-queue_job_cron_jobrunner-20231219 branch from 993e6bb to 38b4ed0 Compare December 19, 2023 17:36
@ivantodorovich
Copy link
Contributor

@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 😓

Copy link
Contributor

@ivantodorovich ivantodorovich left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It makes sense 👍🏻

@petrus-v
Copy link
Contributor Author

@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 :)

@OCA-git-bot
Copy link
Contributor

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). 🤖

@gurneyalex
Copy link
Member

are you aware of #612?

@petrus-v
Copy link
Contributor Author

petrus-v commented Jan 8, 2024

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 petrus-v changed the title [14.0] foodles_queue_job_cron_jobrunner: avoid concurrent access on ir.cron [14.0] queue_job_cron_jobrunner: avoid concurrent access on ir.cron Jan 8, 2024
Copy link
Member

@guewen guewen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/ocabot merge patch

@OCA-git-bot
Copy link
Contributor

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 OCA-git-bot merged commit 659b441 into OCA:14.0 Apr 4, 2024
@OCA-git-bot
Copy link
Contributor

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

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants