summary refs log tree commit diff
path: root/synapse/util/logutils.py
diff options
context:
space:
mode:
authorhera <matrix@template.upcloud.com>2018-08-21 19:12:14 +0000
committerhera <matrix@template.upcloud.com>2018-08-21 19:12:14 +0000
commitd1065e6f512447e6ba9dc4beddf26695880023e1 (patch)
tree4c54a1e7e9f62bda2689bd47f69d65708fd3b7c8 /synapse/util/logutils.py
parentMerge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes (diff)
parentchangelog (diff)
downloadsynapse-d1065e6f512447e6ba9dc4beddf26695880023e1.tar.xz
Merge tag 'v0.33.3rc2' into matrix-org-hotfixes
Bugfixes
--------

- Fix bug in v0.33.3rc1 which caused infinite loops and OOMs
([\#3723](https://github.com/matrix-org/synapse/issues/3723))
Diffstat (limited to 'synapse/util/logutils.py')
-rw-r--r--synapse/util/logutils.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/synapse/util/logutils.py b/synapse/util/logutils.py

index 62a00189cc..ef31458226 100644 --- a/synapse/util/logutils.py +++ b/synapse/util/logutils.py
@@ -20,6 +20,8 @@ import time from functools import wraps from inspect import getcallargs +from six import PY3 + _TIME_FUNC_ID = 0 @@ -28,8 +30,12 @@ def _log_debug_as_f(f, msg, msg_args): logger = logging.getLogger(name) if logger.isEnabledFor(logging.DEBUG): - lineno = f.func_code.co_firstlineno - pathname = f.func_code.co_filename + if PY3: + lineno = f.__code__.co_firstlineno + pathname = f.__code__.co_filename + else: + lineno = f.func_code.co_firstlineno + pathname = f.func_code.co_filename record = logging.LogRecord( name=name,