diff options
author | Richard van der Hoff <richard@matrix.org> | 2018-08-17 00:43:43 +0100 |
---|---|---|
committer | Richard van der Hoff <richard@matrix.org> | 2018-08-17 00:43:43 +0100 |
commit | 0e8d78f6aa56020ffb948a4b2c6feadba2d16712 (patch) | |
tree | 391fb5435e9a314730c27c3e041cd06fee5d0e03 /synapse/app/federation_sender.py | |
parent | Merge pull request #3705 from matrix-org/erikj/fix_inbound_fed_worker (diff) | |
download | synapse-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/federation_sender.py')
-rw-r--r-- | synapse/app/federation_sender.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/synapse/app/federation_sender.py b/synapse/app/federation_sender.py index 7a4310ca18..d59007099b 100644 --- a/synapse/app/federation_sender.py +++ b/synapse/app/federation_sender.py @@ -144,8 +144,9 @@ class FederationSenderReplicationHandler(ReplicationClientHandler): super(FederationSenderReplicationHandler, self).__init__(hs.get_datastore()) self.send_handler = FederationSenderHandler(hs, self) + @defer.inlineCallbacks def on_rdata(self, stream_name, token, rows): - super(FederationSenderReplicationHandler, self).on_rdata( + yield super(FederationSenderReplicationHandler, self).on_rdata( stream_name, token, rows ) self.send_handler.process_replication_rows(stream_name, token, rows) |