Log stacktraces when we fail to send a request to the main proc

This commit is contained in:
Richard van der Hoff 2021-06-08 17:52:14 +01:00
parent beb251e3ee
commit e2aa0b688c
2 changed files with 4 additions and 1 deletions

1
changelog.d/10144.misc Normal file
View file

@ -0,0 +1 @@
Log a stacktrace when we fail to send a request to the main process.

View file

@ -255,8 +255,10 @@ class ReplicationEndpoint(metaclass=abc.ABCMeta):
_outgoing_request_counter.labels(cls.NAME, e.code).inc()
raise e.to_synapse_error()
except Exception as e:
# raise a generic exception rather than a SynapseError to make sure
# we get a stacktrace for this one.
_outgoing_request_counter.labels(cls.NAME, "ERR").inc()
raise SynapseError(502, "Failed to talk to main process") from e
raise RuntimeError("Failed to talk to main process") from e
_outgoing_request_counter.labels(cls.NAME, 200).inc()
return result