summary refs log tree commit diff
path: root/synapse/app
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2020-10-02 15:20:45 +0100
committerGitHub <noreply@github.com>2020-10-02 15:20:45 +0100
commite3debf9682ed59b2972f236fe2982b6af0a9bb9a (patch)
tree787d27e9ae5eb63e3d3b5d40868ace3aed16cbb9 /synapse/app
parentSpeed up unit tests when using PostgreSQL (#8450) (diff)
downloadsynapse-e3debf9682ed59b2972f236fe2982b6af0a9bb9a.tar.xz
Add logging on startup/shutdown (#8448)
This is so we can tell what is going on when things are taking a while to start up.

The main change here is to ensure that transactions that are created during startup get correctly logged like normal transactions.
Diffstat (limited to 'synapse/app')
-rw-r--r--synapse/app/_base.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/synapse/app/_base.py b/synapse/app/_base.py
index 8bb0b142ca..f6f7b2bf42 100644
--- a/synapse/app/_base.py
+++ b/synapse/app/_base.py
@@ -272,6 +272,11 @@ def start(hs: "synapse.server.HomeServer", listeners: Iterable[ListenerConfig]):
         hs.get_datastore().db_pool.start_profiling()
         hs.get_pusherpool().start()
 
+        # Log when we start the shut down process.
+        hs.get_reactor().addSystemEventTrigger(
+            "before", "shutdown", logger.info, "Shutting down..."
+        )
+
         setup_sentry(hs)
         setup_sdnotify(hs)