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

Commit 81364db

Browse files
authored
Run _handle_queued_pdus as a background process (#12041)
... to ensure it gets a proper log context, mostly.
1 parent 235d291 commit 81364db

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

changelog.d/12041.misc

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
After joining a room, create a dedicated logcontext to process the queued events.

synapse/handlers/federation.py

+4-2
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,8 @@
4949
make_deferred_yieldable,
5050
nested_logging_context,
5151
preserve_fn,
52-
run_in_background,
5352
)
53+
from synapse.metrics.background_process_metrics import run_as_background_process
5454
from synapse.replication.http.federation import (
5555
ReplicationCleanRoomRestServlet,
5656
ReplicationStoreRoomOnOutlierMembershipRestServlet,
@@ -559,7 +559,9 @@ async def do_invite_join(
559559
# lots of requests for missing prev_events which we do actually
560560
# have. Hence we fire off the background task, but don't wait for it.
561561

562-
run_in_background(self._handle_queued_pdus, room_queue)
562+
run_as_background_process(
563+
"handle_queued_pdus", self._handle_queued_pdus, room_queue
564+
)
563565

564566
async def do_knock(
565567
self,

0 commit comments

Comments
 (0)