diff options
author | Richard van der Hoff <richard@matrix.org> | 2018-07-23 22:13:19 +0100 |
---|---|---|
committer | Richard van der Hoff <richard@matrix.org> | 2018-07-23 22:13:19 +0100 |
commit | ce0c18dec5d04626018b8e401273c8f30e88b0c7 (patch) | |
tree | 57d48ca17f40ed52b5d87c2ce52b57f35d64d692 /synapse/federation | |
parent | Merge pull request #3584 from matrix-org/erikj/use_cached (diff) | |
download | synapse-ce0c18dec5d04626018b8e401273c8f30e88b0c7.tar.xz |
Improve logging for exceptions handling PDUs
when we get an exception handling a federation PDU, log the whole stacktrace.
Diffstat (limited to 'synapse/federation')
-rw-r--r-- | synapse/federation/federation_server.py | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/synapse/federation/federation_server.py b/synapse/federation/federation_server.py index 48f26db67c..e501251b6e 100644 --- a/synapse/federation/federation_server.py +++ b/synapse/federation/federation_server.py @@ -24,6 +24,7 @@ from prometheus_client import Counter from twisted.internet import defer from twisted.internet.abstract import isIPAddress +from twisted.python import failure from synapse.api.constants import EventTypes from synapse.api.errors import AuthError, FederationError, NotFoundError, SynapseError @@ -186,8 +187,12 @@ class FederationServer(FederationBase): logger.warn("Error handling PDU %s: %s", event_id, e) pdu_results[event_id] = {"error": str(e)} except Exception as e: + f = failure.Failure() pdu_results[event_id] = {"error": str(e)} - logger.exception("Failed to handle PDU %s", event_id) + logger.error( + "Failed to handle PDU %s: %s", + event_id, f.getTraceback().rstrip(), + ) yield async.concurrently_execute( process_pdus_for_room, pdus_by_room.keys(), @@ -203,8 +208,8 @@ class FederationServer(FederationBase): ) pdu_failures = getattr(transaction, "pdu_failures", []) - for failure in pdu_failures: - logger.info("Got failure %r", failure) + for fail in pdu_failures: + logger.info("Got failure %r", fail) response = { "pdus": pdu_results, |