summary refs log tree commit diff
path: root/synapse/app/pusher.py
diff options
context:
space:
mode:
authorRichard van der Hoff <richard@matrix.org>2018-08-17 00:43:43 +0100
committerRichard van der Hoff <richard@matrix.org>2018-08-17 00:43:43 +0100
commit0e8d78f6aa56020ffb948a4b2c6feadba2d16712 (patch)
tree391fb5435e9a314730c27c3e041cd06fee5d0e03 /synapse/app/pusher.py
parentMerge pull request #3705 from matrix-org/erikj/fix_inbound_fed_worker (diff)
downloadsynapse-0e8d78f6aa56020ffb948a4b2c6feadba2d16712.tar.xz
Logcontexts for replication command handlers
Run the handlers for replication commands as background processes. This should
improve the visibility in our metrics, and reduce the number of "running db
transaction from sentinel context" warnings.

Ideally it means converting the things that fire off deferreds into the night
into things that actually return a Deferred when they are done. I've made a bit
of a stab at this, but it will probably be leaky.
Diffstat (limited to 'synapse/app/pusher.py')
-rw-r--r--synapse/app/pusher.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/synapse/app/pusher.py b/synapse/app/pusher.py
index 9295a51d5b..aa0938c376 100644
--- a/synapse/app/pusher.py
+++ b/synapse/app/pusher.py
@@ -148,8 +148,9 @@ class PusherReplicationHandler(ReplicationClientHandler):
 
         self.pusher_pool = hs.get_pusherpool()
 
+    @defer.inlineCallbacks
     def on_rdata(self, stream_name, token, rows):
-        super(PusherReplicationHandler, self).on_rdata(stream_name, token, rows)
+        yield super(PusherReplicationHandler, self).on_rdata(stream_name, token, rows)
         run_in_background(self.poke_pushers, stream_name, token, rows)
 
     @defer.inlineCallbacks