details:   https://code.tryton.org/tryton/commit/69857991edf1
branch:    default
user:      Nicolas Évrard <[email protected]>
date:      Wed Sep 23 10:41:33 2026 +0200
description:
        Early exits cache synchronization call when initializing the Pool

        As threads could be launched when clean_timeout is 0, preforking WSGI 
could
        unfortunately fork while in the cache listening thread making the server
        unresponsive.

        Closes #15120
diffstat:

 trytond/trytond/cache.py |  4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diffs (21 lines):

diff -r b127dc05273e -r 69857991edf1 trytond/trytond/cache.py
--- a/trytond/trytond/cache.py  Wed Sep 23 18:11:34 2026 +0200
+++ b/trytond/trytond/cache.py  Wed Sep 23 10:41:33 2026 +0200
@@ -256,6 +256,8 @@
 
     @classmethod
     def sync(cls, transaction):
+        if not Pool().ready:
+            return
         if cls._clean_last is None:
             cls._clean_last = dt.datetime.now()
             return
@@ -298,7 +300,7 @@
         cls._clean_last = dt.datetime.now()
 
     def sync_since(self, value):
-        return self._clean_last > value
+        return self._clean_last is not None and self._clean_last > value
 
     @classmethod
     def commit(cls, transaction):

Reply via email to