summary refs log tree commit diff
path: root/synapse/util/__init__.py
diff options
context:
space:
mode:
authorErik Johnston <erikj@jki.re>2016-12-09 17:27:45 +0000
committerGitHub <noreply@github.com>2016-12-09 17:27:45 +0000
commitb541fac7c391aebd02e45f2b221619191941de34 (patch)
tree59e8f19b6c4e94a01bfb02b7fe9a4c5503949bd8 /synapse/util/__init__.py
parentFix broken README merge (diff)
parentFix unit tests (diff)
downloadsynapse-b541fac7c391aebd02e45f2b221619191941de34.tar.xz
Merge pull request #1683 from matrix-org/erikj/notifier_sadness
Fix rare notifier bug where listeners dont timeout
Diffstat (limited to 'synapse/util/__init__.py')
-rw-r--r--synapse/util/__init__.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/synapse/util/__init__.py b/synapse/util/__init__.py

index c05b9450be..30fc480108 100644 --- a/synapse/util/__init__.py +++ b/synapse/util/__init__.py
@@ -24,6 +24,11 @@ import logging logger = logging.getLogger(__name__) +class DeferredTimedOutError(SynapseError): + def __init__(self): + super(SynapseError).__init__(504, "Timed out") + + def unwrapFirstError(failure): # defer.gatherResults and DeferredLists wrap failures. failure.trap(defer.FirstError) @@ -89,7 +94,7 @@ class Clock(object): def timed_out_fn(): try: - ret_deferred.errback(SynapseError(504, "Timed out")) + ret_deferred.errback(DeferredTimedOutError()) except: pass