summary refs log tree commit diff
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2016-05-09 10:10:06 +0100
committerErik Johnston <erik@matrix.org>2016-05-09 10:10:06 +0100
commitf6ebaf4a3255fa298cb0c8a7f23294265038de7b (patch)
tree3282afbf9be06783c75de258fd396011d418bcb2
parentMerge pull request #767 from matrix-org/erikj/transaction_txn (diff)
downloadsynapse-f6ebaf4a3255fa298cb0c8a7f23294265038de7b.tar.xz
Run transaction queue on reactor
This ensures that any CPU work that happens doesn't block message
sending.
-rw-r--r--synapse/federation/transaction_queue.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/synapse/federation/transaction_queue.py b/synapse/federation/transaction_queue.py
index 1928da03b3..5787f854d4 100644
--- a/synapse/federation/transaction_queue.py
+++ b/synapse/federation/transaction_queue.py
@@ -20,6 +20,7 @@ from .persistence import TransactionActions
 from .units import Transaction
 
 from synapse.api.errors import HttpResponseException
+from synapse.util.async import run_on_reactor
 from synapse.util.logutils import log_function
 from synapse.util.logcontext import PreserveLoggingContext
 from synapse.util.retryutils import (
@@ -199,6 +200,8 @@ class TransactionQueue(object):
     @defer.inlineCallbacks
     @log_function
     def _attempt_new_transaction(self, destination):
+        yield run_on_reactor()
+
         # list of (pending_pdu, deferred, order)
         if destination in self.pending_transactions:
             # XXX: pending_transactions can get stuck on by a never-ending