forked from MirrorHub/synapse
Parse SYNAPSE_ASYNC_IO_REACTOR env variable & log the reactor on startup (#14092)
This commit is contained in:
parent
8faf7245fd
commit
dc37b68a25
3 changed files with 16 additions and 14 deletions
1
changelog.d/14092.misc
Normal file
1
changelog.d/14092.misc
Normal file
|
@ -0,0 +1 @@
|
|||
Run the integration test suites with the asyncio reactor enabled in CI.
|
|
@ -21,6 +21,7 @@ import os
|
|||
import sys
|
||||
|
||||
from synapse.util.rust import check_rust_lib_up_to_date
|
||||
from synapse.util.stringutils import strtobool
|
||||
|
||||
# Check that we're not running on an unsupported Python version.
|
||||
if sys.version_info < (3, 7):
|
||||
|
@ -28,8 +29,7 @@ if sys.version_info < (3, 7):
|
|||
sys.exit(1)
|
||||
|
||||
# Allow using the asyncio reactor via env var.
|
||||
if bool(os.environ.get("SYNAPSE_ASYNC_IO_REACTOR", False)):
|
||||
try:
|
||||
if strtobool(os.environ.get("SYNAPSE_ASYNC_IO_REACTOR", "0")):
|
||||
from incremental import Version
|
||||
|
||||
import twisted
|
||||
|
@ -45,8 +45,6 @@ if bool(os.environ.get("SYNAPSE_ASYNC_IO_REACTOR", False)):
|
|||
from twisted.internet import asyncioreactor
|
||||
|
||||
asyncioreactor.install(asyncio.get_event_loop())
|
||||
except ImportError:
|
||||
pass
|
||||
|
||||
# Twisted and canonicaljson will fail to import when this file is executed to
|
||||
# get the __version__ during a fresh install. That's OK and subsequent calls to
|
||||
|
|
|
@ -326,6 +326,8 @@ def setup_logging(
|
|||
logBeginner: The Twisted logBeginner to use.
|
||||
|
||||
"""
|
||||
from twisted.internet import reactor
|
||||
|
||||
log_config_path = (
|
||||
config.worker.worker_log_config
|
||||
if use_worker_options
|
||||
|
@ -348,3 +350,4 @@ def setup_logging(
|
|||
)
|
||||
logging.info("Server hostname: %s", config.server.server_name)
|
||||
logging.info("Instance name: %s", hs.get_instance_name())
|
||||
logging.info("Twisted reactor: %s", type(reactor).__name__)
|
||||
|
|
Loading…
Reference in a new issue