summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--changelog.d/3473.bugfix1
-rw-r--r--synapse/storage/events.py3
2 files changed, 3 insertions, 1 deletions
diff --git a/changelog.d/3473.bugfix b/changelog.d/3473.bugfix
new file mode 100644
index 0000000000..7244ab59f2
--- /dev/null
+++ b/changelog.d/3473.bugfix
@@ -0,0 +1 @@
+Invalidate cache on correct thread to avoid race
diff --git a/synapse/storage/events.py b/synapse/storage/events.py
index d816d4883c..a54abb9edd 100644
--- a/synapse/storage/events.py
+++ b/synapse/storage/events.py
@@ -801,7 +801,8 @@ class EventsStore(EventsWorkerStore):
                     ]
                 )
 
-                self._curr_state_delta_stream_cache.entity_has_changed(
+                txn.call_after(
+                    self._curr_state_delta_stream_cache.entity_has_changed,
                     room_id, max_stream_order,
                 )