From fef60f62c54a3c83ac11a04f84281d37c049f558 Mon Sep 17 00:00:00 2001 From: Danny de Jong Date: Tue, 6 Jan 2026 14:39:56 +0100 Subject: [PATCH 1/4] [ADD] #12863 Add connection logging --- odoo/sql_db.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/odoo/sql_db.py b/odoo/sql_db.py index 09f497f81ecda..90401764f98cc 100644 --- a/odoo/sql_db.py +++ b/odoo/sql_db.py @@ -649,6 +649,11 @@ def borrow(self, connection_info): self._connections.append((cnx, False)) _logger.info('%r: Free leaked connection to %r', self, cnx.dsn) + _logger.info( + "CONNX %s connections (thread=%s)", + len(self._connections), + str(threading.current_thread().ident) + ) for i, (cnx, used) in enumerate(self._connections): if not used and self._dsn_equals(cnx.dsn, connection_info): try: From 0db129ab533d23bca3696c700568d6404b8ad2ef Mon Sep 17 00:00:00 2001 From: Danny de Jong Date: Wed, 14 Jan 2026 16:25:59 +0100 Subject: [PATCH 2/4] [ADD] #12863 Fix --- odoo/sql_db.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/odoo/sql_db.py b/odoo/sql_db.py index 90401764f98cc..13f1e8cda99d0 100644 --- a/odoo/sql_db.py +++ b/odoo/sql_db.py @@ -652,7 +652,7 @@ def borrow(self, connection_info): _logger.info( "CONNX %s connections (thread=%s)", len(self._connections), - str(threading.current_thread().ident) + str(threading.current_thread().ident), ) for i, (cnx, used) in enumerate(self._connections): if not used and self._dsn_equals(cnx.dsn, connection_info): From 4bc1721f40755a61df457354685fe08cd8fe195e Mon Sep 17 00:00:00 2001 From: Danny de Jong Date: Wed, 14 Jan 2026 20:22:03 +0100 Subject: [PATCH 3/4] [ADD] #12863 Add thread type to log message --- odoo/sql_db.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/odoo/sql_db.py b/odoo/sql_db.py index 13f1e8cda99d0..edc93500c98c9 100644 --- a/odoo/sql_db.py +++ b/odoo/sql_db.py @@ -650,9 +650,10 @@ def borrow(self, connection_info): _logger.info('%r: Free leaked connection to %r', self, cnx.dsn) _logger.info( - "CONNX %s connections (thread=%s)", + "CONNX %s connections (thread=%s, type=%s)", len(self._connections), str(threading.current_thread().ident), + str(getattr(threading.current_thread(), 'type', None)), ) for i, (cnx, used) in enumerate(self._connections): if not used and self._dsn_equals(cnx.dsn, connection_info): From 5e69c759ef987fee7e8f4375d93751574bcef763 Mon Sep 17 00:00:00 2001 From: Danny de Jong Date: Thu, 15 Jan 2026 12:29:56 +0100 Subject: [PATCH 4/4] [ADD] #12863 Add request logging --- odoo/http.py | 1 + 1 file changed, 1 insertion(+) diff --git a/odoo/http.py b/odoo/http.py index 79e6bd085f7b1..16f46e8b7a2ba 100644 --- a/odoo/http.py +++ b/odoo/http.py @@ -2251,6 +2251,7 @@ def fake_start_response(status, headers): request._post_init() current_thread.url = httprequest.url + _logger.info("CONNX ReQuEsT %s - %s - %s - %s - %s", environ.get("REQUEST_METHOD"), environ.get("REQUEST_URI"), environ.get("HTTP_USER_AGENT"), environ.get("HTTP_REFERER"), environ.get("REMOTE_ADDR")) if self.get_static_file(httprequest.path): response = request._serve_static() elif request.db: