-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Parse SYNAPSE_ASYNC_IO_REACTOR env variable & log the reactor on startup #14092
Parse SYNAPSE_ASYNC_IO_REACTOR env variable & log the reactor on startup #14092
Conversation
@@ -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__) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm assuming that we need to install the asyncio reactor first before we do this? But that should have already happened at import time.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's right, the reactor gets installed quite early
except ImportError: | ||
pass |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure what we were hoping to capture in #12135, but we may as well fail loudly. And besides, this is all still experimental.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See #12135 (comment) for why this is in a try-except.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CI was fully green on this PR. I guess we had to fixup whatever that comment was talking about as part of the Rust work in #12595 et al?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe! Not sure. 🤷
@DMRobertson I don't have merge rights on Synapse, so if you're fine with this change, could you merge it for me? |
Sorry, will do. |
This properly parses the
SYNAPSE_ASYNC_IO_REACTOR
environement variable similar to what we do withSYNAPSE_USE_FROZEN_DICTS
.It also logs the reactor class currently being used on startup, to help with debugging.
There also was an unecessary try/catch on the reactor installation that I removed.
This is needed for this PR in sytest: matrix-org/sytest#1301
Related: