Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions odoo/http.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
7 changes: 7 additions & 0 deletions odoo/sql_db.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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):
Expand Down