From d8517da85b3057e186087de146f546de52d7e206 Mon Sep 17 00:00:00 2001 From: Erik Johnston Date: Fri, 6 Sep 2019 10:07:12 +0100 Subject: [PATCH 1/3] Don't assume there is a 'self' arg in @trace decorator --- synapse/logging/opentracing.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/synapse/logging/opentracing.py b/synapse/logging/opentracing.py index 8c574ddd2851..72462530182c 100644 --- a/synapse/logging/opentracing.py +++ b/synapse/logging/opentracing.py @@ -702,15 +702,15 @@ def decorator(func): _opname = opname if opname else func.__name__ @wraps(func) - def _trace_inner(self, *args, **kwargs): + def _trace_inner(*args, **kwargs): if opentracing is None: - return func(self, *args, **kwargs) + return func(*args, **kwargs) scope = start_active_span(_opname) scope.__enter__() try: - result = func(self, *args, **kwargs) + result = func(*args, **kwargs) if isinstance(result, defer.Deferred): def call_back(result): @@ -750,13 +750,13 @@ def tag_args(func): return func @wraps(func) - def _tag_args_inner(self, *args, **kwargs): + def _tag_args_inner(*args, **kwargs): argspec = inspect.getargspec(func) for i, arg in enumerate(argspec.args[1:]): set_tag("ARG_" + arg, args[i]) set_tag("args", args[len(argspec.args) :]) set_tag("kwargs", kwargs) - return func(self, *args, **kwargs) + return func(*args, **kwargs) return _tag_args_inner From 4bc6b7130d60005d21ce9be16682c13e90447430 Mon Sep 17 00:00:00 2001 From: Erik Johnston Date: Fri, 6 Sep 2019 10:13:10 +0100 Subject: [PATCH 2/3] Newsfile --- changelog.d/5991.bugfix | 1 + 1 file changed, 1 insertion(+) create mode 100644 changelog.d/5991.bugfix diff --git a/changelog.d/5991.bugfix b/changelog.d/5991.bugfix new file mode 100644 index 000000000000..b5ba2f9e4683 --- /dev/null +++ b/changelog.d/5991.bugfix @@ -0,0 +1 @@ +Fix broken replication requests when opentracing is enabled. From e5baf80237b1ac2dbaac43b623ab75d1b5c8185a Mon Sep 17 00:00:00 2001 From: Erik Johnston Date: Fri, 6 Sep 2019 10:53:05 +0100 Subject: [PATCH 3/3] Update changelog --- changelog.d/5991.bugfix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/changelog.d/5991.bugfix b/changelog.d/5991.bugfix index b5ba2f9e4683..5c3597cb53c6 100644 --- a/changelog.d/5991.bugfix +++ b/changelog.d/5991.bugfix @@ -1 +1 @@ -Fix broken replication requests when opentracing is enabled. +Fix invalid references to None while opentracing if the log context slips.