summary refs log tree commit diff
path: root/synapse
diff options
context:
space:
mode:
Diffstat (limited to 'synapse')
-rw-r--r--synapse/storage/_base.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/synapse/storage/_base.py b/synapse/storage/_base.py
index 8384299a13..99c0948754 100644
--- a/synapse/storage/_base.py
+++ b/synapse/storage/_base.py
@@ -205,8 +205,14 @@ class CacheDescriptor(object):
                     self.function_to_call,
                     obj, *args, **kwargs
                 )
-                ret = ObservableDeferred(ret, consumeErrors=False)
 
+                def onErr(f):
+                    cache.invalidate(*keyargs)
+                    return f
+
+                ret.addErrback(onErr)
+
+                ret = ObservableDeferred(ret, consumeErrors=False)
                 cache.update(sequence, *(keyargs + [ret]))
 
                 return ret.observe()