diff options
author | David Robertson <davidr@element.io> | 2021-10-13 10:38:22 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-10-13 09:38:22 +0000 |
commit | b83e82255630f2ba7ea959b68e5a82b4d938f000 (patch) | |
tree | 8e5ee3373e3686a21b3ed7756639af8e553a5195 /synapse/logging/opentracing.py | |
parent | Fix formatting string when oEmbed errors occur. (#11061) (diff) | |
download | synapse-b83e82255630f2ba7ea959b68e5a82b4d938f000.tar.xz |
Stop user directory from failing if it encounters users not in the `users` table. (#11053)
The following scenarios would halt the user directory updater: - user joins room - user leaves room - user present in room which switches from private to public, or vice versa. for two classes of users: - appservice senders - users missing from the user table. If this happened, the user directory would be stuck, unable to make forward progress. Exclude both cases from the user directory, so that we ignore them. Co-authored-by: Eric Eastwood <erice@element.io> Co-authored-by: reivilibre <oliverw@matrix.org> Co-authored-by: Sean Quah <8349537+squahtx@users.noreply.github.com> Co-authored-by: Brendan Abolivier <babolivier@matrix.org>
Diffstat (limited to 'synapse/logging/opentracing.py')
-rw-r--r-- | synapse/logging/opentracing.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/synapse/logging/opentracing.py b/synapse/logging/opentracing.py index 5276c4bfcc..20d23a4260 100644 --- a/synapse/logging/opentracing.py +++ b/synapse/logging/opentracing.py @@ -807,6 +807,14 @@ def trace(func=None, opname=None): result.addCallbacks(call_back, err_back) else: + if inspect.isawaitable(result): + logger.error( + "@trace may not have wrapped %s correctly! " + "The function is not async but returned a %s.", + func.__qualname__, + type(result).__name__, + ) + scope.__exit__(None, None, None) return result |