diff options
author | Erik Johnston <erik@matrix.org> | 2015-02-18 10:29:54 +0000 |
---|---|---|
committer | Erik Johnston <erik@matrix.org> | 2015-02-18 10:29:54 +0000 |
commit | 2635d4e63459d77342d42ef4d2349524bf8fc982 (patch) | |
tree | c686ff3d612fe3f94b4e7d0e95e9d54da920a190 /synapse/federation/transaction_queue.py | |
parent | Merge branch 'hotfixes-v0.7.0g' of github.com:matrix-org/synapse into develop (diff) | |
parent | Merge pull request #77 from matrix-org/failures (diff) | |
download | synapse-2635d4e63459d77342d42ef4d2349524bf8fc982.tar.xz |
Merge branch 'develop' of github.com:matrix-org/synapse into develop
Diffstat (limited to 'synapse/federation/transaction_queue.py')
-rw-r--r-- | synapse/federation/transaction_queue.py | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/synapse/federation/transaction_queue.py b/synapse/federation/transaction_queue.py index bb20f2ebab..6faaa066fb 100644 --- a/synapse/federation/transaction_queue.py +++ b/synapse/federation/transaction_queue.py @@ -91,7 +91,7 @@ class TransactionQueue(object): if not deferred.called: deferred.errback(failure) else: - logger.warn("Failed to send pdu", failure) + logger.warn("Failed to send pdu", failure.value) with PreserveLoggingContext(): self._attempt_new_transaction(destination).addErrback(eb) @@ -116,7 +116,7 @@ class TransactionQueue(object): if not deferred.called: deferred.errback(failure) else: - logger.warn("Failed to send edu", failure) + logger.warn("Failed to send edu", failure.value) with PreserveLoggingContext(): self._attempt_new_transaction(destination).addErrback(eb) @@ -133,6 +133,15 @@ class TransactionQueue(object): (failure, deferred) ) + def eb(failure): + if not deferred.called: + deferred.errback(failure) + else: + logger.warn("Failed to send failure", failure.value) + + with PreserveLoggingContext(): + self._attempt_new_transaction(destination).addErrback(eb) + yield deferred @defer.inlineCallbacks @@ -249,6 +258,15 @@ class TransactionQueue(object): transaction, json_data_cb ) code = 200 + + if response: + for e_id, r in getattr(response, "pdus", {}).items(): + if "error" in r: + logger.warn( + "Transaction returned error for %s: %s", + e_id, r, + ) + except HttpResponseException as e: code = e.code response = e.response |