diff options
| author | Olivier Dony <odo@odoo.com> | 2021-01-29 18:58:14 +0000 |
|---|---|---|
| committer | Olivier Dony <odo@odoo.com> | 2021-02-01 12:01:48 +0000 |
| commit | 3585c2c38955ece4292da77de7173fb31a6992ba (patch) | |
| tree | c29e108c1f059b5f87a8f889a166db81e0ca7cb3 /odoo/modules | |
| parent | 87aef4e3a36d92462454f51960abf7215c5ab7f1 (diff) | |
[FIX] registry: prevent inherited phantom cache clears
This patch complements the previous one by ensuring that any
`cache_invalidated=True` flag inherited from the master process
(pre-fork mode) cannot trigger a cache clear.
This could occur when the first request is served, because the flag was
never clear in the master process, which never server any request.
At the end of `check_signaling()`, the local cache has either been
cleared because a (real) increment of the cache sequence was detected,
or it is considered still valid. The final state of the
`cache_invalidated` flag should reflect this, by being `False`.
closes odoo/odoo#65303
Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
Diffstat (limited to 'odoo/modules')
| -rw-r--r-- | odoo/modules/registry.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/odoo/modules/registry.py b/odoo/modules/registry.py index 3397ab407ed..c9e0497637a 100644 --- a/odoo/modules/registry.py +++ b/odoo/modules/registry.py @@ -601,7 +601,11 @@ class Registry(Mapping): elif self.cache_sequence != c: _logger.info("Invalidating all model caches after database signaling.") self.clear_caches() - self.cache_invalidated = False + + # prevent re-signaling the clear_caches() above, or any residual one that + # would be inherited from the master process (first request in pre-fork mode) + self.cache_invalidated = False + self.registry_sequence = r self.cache_sequence = c |
