Skip to content

Commit

Permalink
test having a clock.sleep(0) to allow the reactor to not hog the whol…
Browse files Browse the repository at this point in the history
…e cpu and starve everything else

Had a reactor tick up to 47 seconds, let's not do that
  • Loading branch information
realtyem committed Nov 13, 2023
1 parent ba5856c commit 1e9aba3
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions synapse/storage/databases/main/event_federation.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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 (
_,
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit 1e9aba3

Please sign in to comment.