diff options
author | Richard van der Hoff <1389908+richvdh@users.noreply.github.com> | 2020-09-07 13:36:02 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-09-07 13:36:02 +0100 |
commit | 0dae7d80bfb497d417a53e52b8353bbcd6d10d58 (patch) | |
tree | dfd723493a93ce2e78c20cc13767ee379bc0ed50 /synapse/storage/util | |
parent | Refuse to upgrade database on worker processes (#8266) (diff) | |
download | synapse-0dae7d80bfb497d417a53e52b8353bbcd6d10d58.tar.xz |
Add more logging to debug slow startup (#8264)
I'm hoping this will provide some pointers for debugging https://github.com/matrix-org/synapse/issues/7968.
Diffstat (limited to 'synapse/storage/util')
-rw-r--r-- | synapse/storage/util/id_generators.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/synapse/storage/util/id_generators.py b/synapse/storage/util/id_generators.py index 76bc3afdfa..b7eb4f8ac9 100644 --- a/synapse/storage/util/id_generators.py +++ b/synapse/storage/util/id_generators.py @@ -15,6 +15,7 @@ import contextlib import heapq +import logging import threading from collections import deque from typing import Dict, List, Set @@ -24,6 +25,8 @@ from typing_extensions import Deque from synapse.storage.database import DatabasePool, LoggingTransaction from synapse.storage.util.sequence import PostgresSequenceGenerator +logger = logging.getLogger(__name__) + class IdGenerator: def __init__(self, db_conn, table, column): @@ -48,6 +51,8 @@ def _load_current_id(db_conn, table, column, step=1): Returns: int """ + # debug logging for https://github.com/matrix-org/synapse/issues/7968 + logger.info("initialising stream generator for %s(%s)", table, column) cur = db_conn.cursor() if step == 1: cur.execute("SELECT MAX(%s) FROM %s" % (column, table)) |