Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
synapse
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Monitor
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Maunium
synapse
Commits
dc37b68a
Unverified
Commit
dc37b68a
authored
2 years ago
by
Quentin Gliech
Committed by
GitHub
2 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Parse SYNAPSE_ASYNC_IO_REACTOR env variable & log the reactor on startup (#14092)
parent
8faf7245
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
changelog.d/14092.misc
+1
-0
1 addition, 0 deletions
changelog.d/14092.misc
synapse/__init__.py
+12
-14
12 additions, 14 deletions
synapse/__init__.py
synapse/config/logger.py
+3
-0
3 additions, 0 deletions
synapse/config/logger.py
with
16 additions
and
14 deletions
changelog.d/14092.misc
0 → 100644
+
1
−
0
View file @
dc37b68a
Run the integration test suites with the asyncio reactor enabled in CI.
This diff is collapsed.
Click to expand it.
synapse/__init__.py
+
12
−
14
View file @
dc37b68a
...
@@ -21,6 +21,7 @@ import os
...
@@ -21,6 +21,7 @@ import os
import
sys
import
sys
from
synapse.util.rust
import
check_rust_lib_up_to_date
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.
# Check that we're not running on an unsupported Python version.
if
sys
.
version_info
<
(
3
,
7
):
if
sys
.
version_info
<
(
3
,
7
):
...
@@ -28,25 +29,22 @@ if sys.version_info < (3, 7):
...
@@ -28,25 +29,22 @@ if sys.version_info < (3, 7):
sys
.
exit
(
1
)
sys
.
exit
(
1
)
# Allow using the asyncio reactor via env var.
# Allow using the asyncio reactor via env var.
if
bool
(
os
.
environ
.
get
(
"
SYNAPSE_ASYNC_IO_REACTOR
"
,
False
)):
if
strtobool
(
os
.
environ
.
get
(
"
SYNAPSE_ASYNC_IO_REACTOR
"
,
"
0
"
)):
try
:
from
incremental
import
Version
from
incremental
import
Version
import
twisted
import
twisted
# We need a bugfix that is included in Twisted 21.2.0:
# We need a bugfix that is included in Twisted 21.2.0:
# https://twistedmatrix.com/trac/ticket/9787
# https://twistedmatrix.com/trac/ticket/9787
if
twisted
.
version
<
Version
(
"
Twisted
"
,
21
,
2
,
0
):
if
twisted
.
version
<
Version
(
"
Twisted
"
,
21
,
2
,
0
):
print
(
"
Using asyncio reactor requires Twisted>=21.2.0
"
)
print
(
"
Using asyncio reactor requires Twisted>=21.2.0
"
)
sys
.
exit
(
1
)
sys
.
exit
(
1
)
import
asyncio
import
asyncio
from
twisted.internet
import
asyncioreactor
from
twisted.internet
import
asyncioreactor
asyncioreactor
.
install
(
asyncio
.
get_event_loop
())
asyncioreactor
.
install
(
asyncio
.
get_event_loop
())
except
ImportError
:
pass
# Twisted and canonicaljson will fail to import when this file is executed to
# 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
# get the __version__ during a fresh install. That's OK and subsequent calls to
...
...
This diff is collapsed.
Click to expand it.
synapse/config/logger.py
+
3
−
0
View file @
dc37b68a
...
@@ -326,6 +326,8 @@ def setup_logging(
...
@@ -326,6 +326,8 @@ def setup_logging(
logBeginner: The Twisted logBeginner to use.
logBeginner: The Twisted logBeginner to use.
"""
"""
from
twisted.internet
import
reactor
log_config_path
=
(
log_config_path
=
(
config
.
worker
.
worker_log_config
config
.
worker
.
worker_log_config
if
use_worker_options
if
use_worker_options
...
@@ -348,3 +350,4 @@ def setup_logging(
...
@@ -348,3 +350,4 @@ def setup_logging(
)
)
logging
.
info
(
"
Server hostname: %s
"
,
config
.
server
.
server_name
)
logging
.
info
(
"
Server hostname: %s
"
,
config
.
server
.
server_name
)
logging
.
info
(
"
Instance name: %s
"
,
hs
.
get_instance_name
())
logging
.
info
(
"
Instance name: %s
"
,
hs
.
get_instance_name
())
logging
.
info
(
"
Twisted reactor: %s
"
,
type
(
reactor
).
__name__
)
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment