Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Commit

Permalink
Run _handle_queued_pdus as a background process (#12041)
Browse files Browse the repository at this point in the history
... to ensure it gets a proper log context, mostly.
  • Loading branch information
richvdh authored Feb 22, 2022
1 parent 235d291 commit 81364db
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions changelog.d/12041.misc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
After joining a room, create a dedicated logcontext to process the queued events.
6 changes: 4 additions & 2 deletions synapse/handlers/federation.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@
make_deferred_yieldable,
nested_logging_context,
preserve_fn,
run_in_background,
)
from synapse.metrics.background_process_metrics import run_as_background_process
from synapse.replication.http.federation import (
ReplicationCleanRoomRestServlet,
ReplicationStoreRoomOnOutlierMembershipRestServlet,
Expand Down Expand Up @@ -559,7 +559,9 @@ async def do_invite_join(
# lots of requests for missing prev_events which we do actually
# have. Hence we fire off the background task, but don't wait for it.

run_in_background(self._handle_queued_pdus, room_queue)
run_as_background_process(
"handle_queued_pdus", self._handle_queued_pdus, room_queue
)

async def do_knock(
self,
Expand Down

0 comments on commit 81364db

Please sign in to comment.