summary refs log tree commit diff
path: root/synapse/storage/util
diff options
context:
space:
mode:
authorreivilibre <oliverw@matrix.org>2022-09-07 11:03:32 +0000
committerGitHub <noreply@github.com>2022-09-07 12:03:32 +0100
commitd3d9ca156e323fe194b1bcb1af1628f65a2f3c1c (patch)
tree74e19b799192c8be69179e27ceadda7a8beac18c /synapse/storage/util
parentRename the `EventFormatVersions` enum values so that they line up with room v... (diff)
downloadsynapse-d3d9ca156e323fe194b1bcb1af1628f65a2f3c1c.tar.xz
Cancel the processing of key query requests when they time out. (#13680)
Diffstat (limited to 'synapse/storage/util')
-rw-r--r--synapse/storage/util/partial_state_events_tracker.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/synapse/storage/util/partial_state_events_tracker.py b/synapse/storage/util/partial_state_events_tracker.py
index b4bf49dace..8d8894d1d5 100644
--- a/synapse/storage/util/partial_state_events_tracker.py
+++ b/synapse/storage/util/partial_state_events_tracker.py
@@ -24,6 +24,7 @@ from synapse.logging.opentracing import trace_with_opname
 from synapse.storage.databases.main.events_worker import EventsWorkerStore
 from synapse.storage.databases.main.room import RoomWorkerStore
 from synapse.util import unwrapFirstError
+from synapse.util.cancellation import cancellable
 
 logger = logging.getLogger(__name__)
 
@@ -60,6 +61,7 @@ class PartialStateEventsTracker:
                 o.callback(None)
 
     @trace_with_opname("PartialStateEventsTracker.await_full_state")
+    @cancellable
     async def await_full_state(self, event_ids: Collection[str]) -> None:
         """Wait for all the given events to have full state.
 
@@ -154,6 +156,7 @@ class PartialCurrentStateTracker:
                 o.callback(None)
 
     @trace_with_opname("PartialCurrentStateTracker.await_full_state")
+    @cancellable
     async def await_full_state(self, room_id: str) -> None:
         # We add the deferred immediately so that the DB call to check for
         # partial state doesn't race when we unpartial the room.