From 2a7f0b8953516dd142d6b4dea04c9e4203fa688d Mon Sep 17 00:00:00 2001 From: Robert Jacob Date: Sun, 27 Jan 2019 18:00:27 +0100 Subject: Implement workaround for login error. Signed-off-by: Robert Jacob --- changelog.d/4486.bugfix | 1 + synapse/util/logcontext.py | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) create mode 100644 changelog.d/4486.bugfix diff --git a/changelog.d/4486.bugfix b/changelog.d/4486.bugfix new file mode 100644 index 0000000000..64588d509b --- /dev/null +++ b/changelog.d/4486.bugfix @@ -0,0 +1 @@ +Workaround for login error when using both LDAP and internal authentication. diff --git a/synapse/util/logcontext.py b/synapse/util/logcontext.py index 4c6e92beb8..311b49e18a 100644 --- a/synapse/util/logcontext.py +++ b/synapse/util/logcontext.py @@ -285,7 +285,10 @@ class LoggingContext(object): self.alive = False # if we have a parent, pass our CPU usage stats on - if self.parent_context is not None: + if ( + self.parent_context is not None + and hasattr(self.parent_context, '_resource_usage') + ): self.parent_context._resource_usage += self._resource_usage # reset them in case we get entered again -- cgit 1.4.1