Created
January 29, 2021 17:56
-
-
Save odony/675d25b129c7476a3784a7b87ddc4490 to your computer and use it in GitHub Desktop.
registry: avoid phantom cache signaling
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git odoo/modules/registry.py odoo/modules/registry.py | |
index 907e13ef4ae5..c3c317b77f0d 100644 | |
--- odoo/modules/registry.py | |
+++ odoo/modules/registry.py | |
@@ -616,7 +616,6 @@ class Registry(Mapping): | |
if self.cache_sequence != c: | |
_logger.info("Invalidating all model caches after database signaling.") | |
self._clear_cache() | |
- self.cache_invalidated = False | |
if self.cache_longterm_sequence != cl: | |
_logger.info("Invalidating longterm cache after database signaling.") | |
self._clear_cache_longterm() | |
@@ -625,6 +624,10 @@ class Registry(Mapping): | |
self.cache_sequence = c | |
self.cache_longterm_sequence = cl | |
+ # prevent re-signaling the reactive clear_cache() above, or any residual one that | |
+ # would be inherited from the master process (for the first request in pre-fork mode) | |
+ self.cache_invalidated = False | |
+ | |
return self | |
def signal_changes(self): |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment