summary refs log tree commit diff
path: root/synapse
diff options
context:
space:
mode:
authorSean Quah <8349537+squahtx@users.noreply.github.com>2023-01-31 11:31:52 +0000
committerGitHub <noreply@github.com>2023-01-31 11:31:52 +0000
commit805b641fb6b31e677278eaf6e27875eba5c2a3d3 (patch)
tree8e3810b2a7bcd828462679a46af512f10a841487 /synapse
parentMake sqlite database migrations transactional again, part two (#14926) (diff)
downloadsynapse-805b641fb6b31e677278eaf6e27875eba5c2a3d3.tar.xz
Fix "Re-starting finished log context" spam when creating events (#14947)
`run_in_background` calls re-use the current logging context. When they
are not awaited, they can complete after the current logging context has
been marked as finished, which leads to log spam. Use
`run_as_background_process` instead.

Fixes one of the instances of #13090.

Signed-off-by: Sean Quah <seanq@matrix.org>
Diffstat (limited to 'synapse')
-rw-r--r--synapse/handlers/message.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/synapse/handlers/message.py b/synapse/handlers/message.py
index 6290f7f523..e688e00575 100644
--- a/synapse/handlers/message.py
+++ b/synapse/handlers/message.py
@@ -1939,7 +1939,9 @@ class EventCreationHandler:
             if event.type == EventTypes.Message:
                 # We don't want to block sending messages on any presence code. This
                 # matters as sometimes presence code can take a while.
-                run_in_background(self._bump_active_time, requester.user)
+                run_as_background_process(
+                    "bump_presence_active_time", self._bump_active_time, requester.user
+                )
 
         async def _notify() -> None:
             try: