Commit Graph
6 Commits
Author SHA1 Message Date
Adrian Torres 3d1e23aaba [FIX] *: Reset module states on registry init error
Commit 763d714 introduced cron job locking for databases which had
modules with states set to 'to x', however if an
installation/uninstallation/upgrade fails, the state will stay at 'to
x', and it may stay in that state for an indefinite amount of time,
meaning that cron jobs could stay locked forever.

This commit fixes this in part by adding a cleanup function to loading.py that
will be executed whenever load_modules fails, the function will change
every 'to x' module to their original state, effectively unlocking the
execution of cron jobs.

This however only works to prevent "zombie" transient states for
brand new databases, however for existing databases which already
contain some modules in a zombie state it won't do anything unless
a module is installed/uninstalled/upgraded, which may never happen.

This is where the second part comes in (ir_cron.py), when failing to
execute crons, we check if the failure was due to bad module state
and if an arbitrary amount of time (5 hours as of this commit) has passed
since the last time it was supposed to be executed, if it is the case, it means
that the cron execution failed around 5 * 60 times (1 failure per minute for 5h)
in which case we assume that the crons are stuck because the db
has zombie states and we force a call to reset_module_states.
2017-12-01 14:15:42 +00:00
Christophe Simonis 98c71b23d3 [MERGE] forward port branch saas-11 up to 9073ecb6f5 2017-01-06 18:06:14 +01:00
Christophe Simonis 799e7f7740 [FIX] core: leftover openerp use from last forward-port 2017-01-04 19:24:16 +01:00
Christophe Simonis 2217b37130 [MERGE] forward port branch saas-11 up to 573293a06d 2017-01-04 19:15:31 +01:00
Raphael Collet 4a700d0ad9 [FIX] odoo: rename imports and adapt import hooks 2016-09-02 17:28:12 +02:00
Raphael Collet 9e64f9f951 [REF] openerp: move openerp to odoo 2016-09-02 17:28:12 +02:00