-
Notifications
You must be signed in to change notification settings - Fork 394
Fix server_name
in logging context for multiple Synapse instances in one process
#18868
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
b6dbfca
792774b
18aad07
f1117a1
03f617b
a97a847
66aa39f
3a5bab7
7bc92a0
1a50efa
5881e6b
c2faea5
af3bf8e
c77ffe6
7aae4f3
fe0a88d
ee4f13a
7e2a9ab
98198ba
831f619
d6ddf2e
947bd47
02e4e5d
09b9756
44fa84f
7ecb32c
e61366d
3f7c93a
f2f6795
04ed0d8
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Fix `server_name` in logging context for multiple Synapse instances in one process. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Progressed outside of this PR: We have removed enough With this PR, we will be able to distinguish which server sent the logs wherever we're not using |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -411,8 +411,19 @@ def __init__( | |
# Clock is optional as this class is exposed to the module API. | ||
clock: Optional[Clock] = None, | ||
): | ||
""" | ||
Args: | ||
canonical_json: TODO | ||
extract_context: TODO | ||
MadLittleMods marked this conversation as resolved.
Show resolved
Hide resolved
|
||
clock: This is expected to be passed in by any Synapse code. | ||
Only optional for the Module API. | ||
""" | ||
|
||
if clock is None: | ||
clock = Clock(cast(ISynapseThreadlessReactor, reactor)) | ||
clock = Clock( | ||
cast(ISynapseThreadlessReactor, reactor), | ||
server_name="synapse_module_running_from_unknown_server", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is it possible to track which server this is running on? Such information would be useful if a particular module is misbehaving. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. While we could do a pattern like the following today because we expose Modified
|
||
) | ||
|
||
super().__init__(clock, extract_context) | ||
self.canonical_json = canonical_json | ||
|
@@ -590,8 +601,17 @@ def __init__( | |
# Clock is optional as this class is exposed to the module API. | ||
clock: Optional[Clock] = None, | ||
): | ||
""" | ||
Args: | ||
extract_context: TODO | ||
MadLittleMods marked this conversation as resolved.
Show resolved
Hide resolved
|
||
clock: This is expected to be passed in by any Synapse code. | ||
Only optional for the Module API. | ||
""" | ||
if clock is None: | ||
clock = Clock(cast(ISynapseThreadlessReactor, reactor)) | ||
clock = Clock( | ||
cast(ISynapseThreadlessReactor, reactor), | ||
server_name="synapse_module_running_from_unknown_server", | ||
) | ||
|
||
super().__init__(clock, extract_context) | ||
|
||
|
Uh oh!
There was an error while loading. Please reload this page.