summary refs log tree commit diff
diff options
context:
space:
mode:
authorEric Eastwood <erice@element.io>2022-08-18 16:55:11 -0500
committerEric Eastwood <erice@element.io>2022-08-18 16:55:11 -0500
commitdb04b16060cf18c248c92e6c995ea7d1449cad03 (patch)
treee183ce0c3f69d97b1120c7334230009459134a49
parentMerge branch 'madlittlemods/11850-migrate-to-opentelemetry' into madlittlemod... (diff)
downloadsynapse-db04b16060cf18c248c92e6c995ea7d1449cad03.tar.xz
Some cleanup
-rw-r--r--synapse/handlers/federation.py4
-rw-r--r--synapse/logging/tracing.py2
-rw-r--r--synapse/util/ratelimitutils.py3
3 files changed, 6 insertions, 3 deletions
diff --git a/synapse/handlers/federation.py b/synapse/handlers/federation.py
index ad4e09c8f8..9c583720fc 100644
--- a/synapse/handlers/federation.py
+++ b/synapse/handlers/federation.py
@@ -494,6 +494,10 @@ class FederationHandler:
             return False
 
         processing_end_time = self.clock.time_msec()
+        logger.info(
+            "backfill_processing_before_timer asfd=%s",
+            (processing_start_time - processing_end_time) / 1000,
+        )
         backfill_processing_before_timer.observe(
             (processing_start_time - processing_end_time) / 1000
         )
diff --git a/synapse/logging/tracing.py b/synapse/logging/tracing.py
index c8cb17c84e..838b56f807 100644
--- a/synapse/logging/tracing.py
+++ b/synapse/logging/tracing.py
@@ -910,7 +910,9 @@ def trace_with_opname(
 def trace(func: Callable[P, R]) -> Callable[P, R]:
     """
     Decorator to trace a function.
+
     Sets the operation name to that of the function's name.
+
     See the module's doc string for usage examples.
     """
     return trace_with_opname(func.__name__)(func)
diff --git a/synapse/util/ratelimitutils.py b/synapse/util/ratelimitutils.py
index e2acd78595..603570c10f 100644
--- a/synapse/util/ratelimitutils.py
+++ b/synapse/util/ratelimitutils.py
@@ -263,11 +263,8 @@ class _PerHostRatelimiter:
             # Ensure that we've properly cleaned up.
             self.sleeping_requests.discard(request_id)
             self.ready_request_queue.pop(request_id, None)
-            wait_span_cm.__exit__(None, None, None)
             return r
 
-        wait_span_cm = start_active_span("ratelimit wait")
-        wait_span_cm.__enter__()
         ret_defer.addCallbacks(on_start, on_err)
         ret_defer.addBoth(on_both)
         return make_deferred_yieldable(ret_defer)