[FIX] registry: another pass of cleanup for registry signaling
authorOlivier Dony <odo@openerp.com>
Fri, 1 Mar 2013 14:32:03 +0000 (15:32 +0100)
committerOlivier Dony <odo@openerp.com>
Fri, 1 Mar 2013 14:32:03 +0000 (15:32 +0100)
commit9770caedf38a54b810225fb192fd81ec43cc41c5
tree37421c2cb67a5faa3ef477b4af1ca3115d0c7703
parentd48f07fef165db921a85db77b5a3c114d71c5e38
[FIX] registry: another pass of cleanup for registry signaling

Some important points to consider:
 - signaling should be done after any schema alteration (including module [un]installation),
   service registration (e.g. reports)
 - the changes need to be committed to the database *before* signaling, otherwise an
   obvious race condition occurs during reload by other workers
 - any call to restart_pool() must be considered a possible candidate for
   signaling, and the 2 above conditions must be checked

The number of explicit calls was reduced by forcing the signaling at the end of
Registry.new() in case `update_module` was passed as True. In that situation
we always want to signal the changes - so all the redundant signaling calls
can be centralized. We can also assume that the relevant changes have already
been committed at that point, otherwise the registry update would not
have worked in the first place.
This means that there is no need for explicit signaling anymore everytime
`restart_pool` is called with `update_module=True`.

Some missing cr.commit() and explicit signaling calls were added or
moved to the right place. As a reminder: signaling must be done
*after* committing the changes, and usually *after* reloading the
registry on the current worker.

bzr revid: odo@openerp.com-20130301143203-e2csf5pkllwhmwqs
openerp/addons/base/ir/ir_model.py
openerp/addons/base/module/module.py
openerp/addons/base/res/res_config.py
openerp/modules/loading.py
openerp/modules/registry.py