summary refs log tree commit diff
path: root/synapse/crypto
diff options
context:
space:
mode:
authorMark Haines <mjark@negativecurvature.net>2015-05-12 15:25:54 +0100
committerMark Haines <mjark@negativecurvature.net>2015-05-12 15:25:54 +0100
commitec07dba29e43d00e3630e22112e332555dc69b8c (patch)
treef7d8b11b02542260131e9fb3102f1b2a1022baa3 /synapse/crypto
parentMerge pull request #147 from matrix-org/presence-performance (diff)
parentChange the way we create observers to deferreds so that we don't get spammed ... (diff)
downloadsynapse-ec07dba29e43d00e3630e22112e332555dc69b8c.tar.xz
Merge pull request #143 from matrix-org/erikj/SYN-375
SYN-375 - Lots of unhandled deferred exceptions.
Diffstat (limited to 'synapse/crypto')
-rw-r--r--synapse/crypto/keyring.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/synapse/crypto/keyring.py b/synapse/crypto/keyring.py
index 8709394b97..a859872ce2 100644
--- a/synapse/crypto/keyring.py
+++ b/synapse/crypto/keyring.py
@@ -26,7 +26,7 @@ from synapse.api.errors import SynapseError, Codes
 
 from synapse.util.retryutils import get_retry_limiter
 
-from synapse.util.async import create_observer
+from synapse.util.async import ObservableDeferred
 
 from OpenSSL import crypto
 
@@ -111,6 +111,10 @@ class Keyring(object):
 
         if download is None:
             download = self._get_server_verify_key_impl(server_name, key_ids)
+            download = ObservableDeferred(
+                download,
+                consumeErrors=True
+            )
             self.key_downloads[server_name] = download
 
             @download.addBoth
@@ -118,7 +122,7 @@ class Keyring(object):
                 del self.key_downloads[server_name]
                 return ret
 
-        r = yield create_observer(download)
+        r = yield download.observe()
         defer.returnValue(r)
 
     @defer.inlineCallbacks