From 1e9aba3f8c55846d7b1d6fa9cfae2a5fb0ffd3f8 Mon Sep 17 00:00:00 2001 From: Jason Little Date: Mon, 13 Nov 2023 04:32:42 -0600 Subject: [PATCH] test having a clock.sleep(0) to allow the reactor to not hog the whole cpu and starve everything else Had a reactor tick up to 47 seconds, let's not do that --- synapse/storage/databases/main/event_federation.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/synapse/storage/databases/main/event_federation.py b/synapse/storage/databases/main/event_federation.py index cb5b5d4cdd86..89a724e8e31a 100644 --- a/synapse/storage/databases/main/event_federation.py +++ b/synapse/storage/databases/main/event_federation.py @@ -338,6 +338,7 @@ def _get_auth_chain_ids_using_cover_index_txn( self._authchain_s1_lookup_lock.discard(event_id) # Only toss the event because it was found initial_events_copy.discard(event_id) + self._clock.sleep(0) # And now process the data that was retrieved for _, chain_id, sequence_number in section_1_rows: @@ -440,6 +441,7 @@ def _get_auth_chain_ids_using_cover_index_txn( self._authchain_s2_lookup_lock.discard(chain_id) del event_chains[chain_id] + self._clock.sleep(0) for ( _, @@ -512,6 +514,7 @@ def _get_auth_chain_ids_using_cover_index_txn( s3(chain_id, new_s3_cache_entry) self._authchain_s3_lookup_lock.discard(chain_id) del chains[chain_id] + self._clock.sleep(0) for ( result_event_id,