diff --git a/odoo/http.py b/odoo/http.py index 79e6bd085f7b1..10db1e1f00d95 100644 --- a/odoo/http.py +++ b/odoo/http.py @@ -1858,6 +1858,12 @@ def _serve_ir_http(self): """ ir_http = self.registry['ir.http'] + if len(self.registry._db.pool._connections) > 20: + _logger.info( + "CONNX %i req %s", + len(self.registry._db.pool._connections), + self.httprequest.path + ) try: rule, args = ir_http._match(self.httprequest.path) except NotFound: diff --git a/odoo/sql_db.py b/odoo/sql_db.py index 09f497f81ecda..820e81814ca65 100644 --- a/odoo/sql_db.py +++ b/odoo/sql_db.py @@ -649,6 +649,12 @@ 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, 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): try: @@ -736,6 +742,7 @@ def __init__(self, pool, dbname, dsn): self.__dbname = dbname self.__dsn = dsn self.__pool = pool + self.pool = pool @property def dsn(self):