From 81f4ab7587ba2547848006ae2549ae50f4e1ca27 Mon Sep 17 00:00:00 2001 From: Richard van der Hoff Date: Fri, 18 Feb 2022 18:50:48 +0000 Subject: [PATCH 1/4] run _handle_queued_pdus as a background process --- synapse/handlers/federation.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/synapse/handlers/federation.py b/synapse/handlers/federation.py index c0f642005ff4..52b9dc20ba4b 100644 --- a/synapse/handlers/federation.py +++ b/synapse/handlers/federation.py @@ -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, From 6f1c90b8ded61610ab6b45e49bdfaede4e78e583 Mon Sep 17 00:00:00 2001 From: Richard van der Hoff Date: Mon, 21 Feb 2022 12:56:09 +0000 Subject: [PATCH 2/4] fix imports --- synapse/handlers/federation.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/synapse/handlers/federation.py b/synapse/handlers/federation.py index 52b9dc20ba4b..579cd4a60107 100644 --- a/synapse/handlers/federation.py +++ b/synapse/handlers/federation.py @@ -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, From 7609dac10e668b914498d9c411f2a7ce2a6b0c2c Mon Sep 17 00:00:00 2001 From: Richard van der Hoff Date: Mon, 21 Feb 2022 13:02:51 +0000 Subject: [PATCH 3/4] changelog --- changelog.d/12049.misc | 1 + 1 file changed, 1 insertion(+) create mode 100644 changelog.d/12049.misc diff --git a/changelog.d/12049.misc b/changelog.d/12049.misc new file mode 100644 index 000000000000..e56dc093def6 --- /dev/null +++ b/changelog.d/12049.misc @@ -0,0 +1 @@ +After joining a room, create a dedicated logcontext to process the queued events. From f668c484a1b12a9d5815fecbb7d1700eb61314c1 Mon Sep 17 00:00:00 2001 From: Richard van der Hoff <1389908+richvdh@users.noreply.github.com> Date: Tue, 22 Feb 2022 13:04:32 +0000 Subject: [PATCH 4/4] Rename 12049.misc to 12041.misc --- changelog.d/{12049.misc => 12041.misc} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename changelog.d/{12049.misc => 12041.misc} (100%) diff --git a/changelog.d/12049.misc b/changelog.d/12041.misc similarity index 100% rename from changelog.d/12049.misc rename to changelog.d/12041.misc