diff options
author | Erik Johnston <erik@matrix.org> | 2015-02-05 14:06:13 +0000 |
---|---|---|
committer | Erik Johnston <erik@matrix.org> | 2015-02-05 14:06:13 +0000 |
commit | 4996398858c26b623d98320a60bd891c6c608418 (patch) | |
tree | d1f0646f53488933de7b96055e8b302ccb2372d0 /synapse/federation/transaction_queue.py | |
parent | Merge pull request #47 from matrix-org/signature_failures (diff) | |
parent | Merge branch 'develop' of github.com:matrix-org/synapse into federation_clien... (diff) | |
download | synapse-4996398858c26b623d98320a60bd891c6c608418.tar.xz |
Merge branch 'federation_client_retries' of github.com:matrix-org/synapse into develop
Diffstat (limited to 'synapse/federation/transaction_queue.py')
-rw-r--r-- | synapse/federation/transaction_queue.py | 23 |
1 files changed, 18 insertions, 5 deletions
diff --git a/synapse/federation/transaction_queue.py b/synapse/federation/transaction_queue.py index 9d4f2c09a2..f38aeba7cc 100644 --- a/synapse/federation/transaction_queue.py +++ b/synapse/federation/transaction_queue.py @@ -19,6 +19,7 @@ from twisted.internet import defer from .persistence import TransactionActions from .units import Transaction +from synapse.api.errors import HttpResponseException from synapse.util.logutils import log_function from synapse.util.logcontext import PreserveLoggingContext @@ -238,9 +239,14 @@ class TransactionQueue(object): del p["age_ts"] return data - code, response = yield self.transport_layer.send_transaction( - transaction, json_data_cb - ) + try: + response = yield self.transport_layer.send_transaction( + transaction, json_data_cb + ) + code = 200 + except HttpResponseException as e: + code = e.code + response = e.response logger.info("TX [%s] got %d response", destination, code) @@ -274,8 +280,7 @@ class TransactionQueue(object): pass logger.debug("TX [%s] Yielded to callbacks", destination) - - except Exception as e: + except RuntimeError as e: # We capture this here as there as nothing actually listens # for this finishing functions deferred. logger.warn( @@ -283,6 +288,14 @@ class TransactionQueue(object): destination, e, ) + except Exception as e: + # We capture this here as there as nothing actually listens + # for this finishing functions deferred. + logger.exception( + "TX [%s] Problem in _attempt_transaction: %s", + destination, + e, + ) self.set_retrying(destination, retry_interval) |