c06cee44fe1328ecafbaae6c4ca3ab85a6ef2de5
Start Odoo with multiple cron threads (e.g. --max-cron-threads=4), trigger many crons at once, there is a chance one of the cron thread fails due to a serialization error. Inside of the `_acquire_one_job` function, the query evaluates many rows to find one that fit multiple requirements. Two of those requirements are (1) that the `nextcall` of the row is in the past or (2) that it exists a cron trigger for that cron with a `call_at` in the past. In case the `nextcall` of one of those rows is modified or the cron triggers are removed by another transaction then there can be a serialisation failure in the current transaction. This serialisation error is important, it prevents the current cron worker from acquiring a cron job that has been processed in another cron worker. The problem is that that postgres doesn't tell which row was modified by the other transaction (=processed by another worker cron) so it is not possible to just skip that cron and continue with the others. Our solution is to limit the WHERE clause of the `_acquire_one_job` function to a single row. In case there is a serialization failure we know the cron was processed in another job and we can skip it. Closes #96584 closes odoo/odoo#96926 X-original-commit: 684750a0c2c83acffb32e555bd3140a2c76d7219 Signed-off-by: Julien Castiaux <juc@odoo.com> Co-authored-by: Julien Castiaux <juc@odoo.com>
Odoo
Odoo is a suite of web based open source business apps.
The main Odoo Apps include an Open Source CRM, Website Builder, eCommerce, Warehouse Management, Project Management, Billing & Accounting, Point of Sale, Human Resources, Marketing, Manufacturing, ...
Odoo Apps can be used as stand-alone applications, but they also integrate seamlessly so you get a full-featured Open Source ERP when you install several Apps.
Getting started with Odoo
For a standard installation please follow the Setup instructions from the documentation.
To learn the software, we recommend the Odoo eLearning, or Scale-up, the business game. Developers can start with the developer tutorials
Languages
Python
49.6%
JavaScript
47.8%
SCSS
2%
CSS
0.3%
HTML
0.2%