mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-06-19 09:54:07 -04:00
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.
This commit is contained in:
parent
96312536f2
commit
0dae7d80bf
5 changed files with 33 additions and 7 deletions
|
@ -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))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue