From ac6e93b07831efda349f01d64271267be88a7a2a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20=C3=89vrard?= Date: Tue, 17 Dec 2024 15:14:04 +0100 Subject: [PATCH] Reset the pool instances only on the pool initialization In a scenario where cache_timeout is set to zero, concurrent updates to the pool might result in an empty pool dictionary because the process making the update lose its reference to the updated pool thus replacing it with an empty dictionary on the following instantiation of Pool. Closes #13763 --- trytond/trytond/pool.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/trytond/trytond/pool.py b/trytond/trytond/pool.py index 7d4ac736dd..9d8ab63780 100644 --- a/trytond/trytond/pool.py +++ b/trytond/trytond/pool.py @@ -117,7 +117,6 @@ class Pool(object): ''' with cls._lock: cls._pools.pop(database_name, None) - cls._pool_instances.clear() @classmethod def database_list(cls): @@ -147,6 +146,7 @@ class Pool(object): self._pools[self.database_name] = self._pool self._pool_modules[self.database_name] = self._modules self._pool_instances.clear() + self._pool_instances.add(self) if restart: self.init()