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
Package registry
Container Registry
Model registry
Operate
Terraform modules
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
Timo Ley
synapse
Commits
60adcbed
Unverified
Commit
60adcbed
authored
4 years ago
by
Richard van der Hoff
Committed by
GitHub
4 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Fix "'NoneType' has no attribute start|stop" logcontext errors (#7181)
Fixes #7179.
parent
fe1580bf
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/7181.misc
+1
-0
1 addition, 0 deletions
changelog.d/7181.misc
synapse/http/site.py
+6
-7
6 additions, 7 deletions
synapse/http/site.py
synapse/logging/context.py
+5
-0
5 additions, 0 deletions
synapse/logging/context.py
with
12 additions
and
7 deletions
changelog.d/7181.misc
0 → 100644
+
1
−
0
View file @
60adcbed
Clean up some LoggingContext code.
This diff is collapsed.
Click to expand it.
synapse/http/site.py
+
6
−
7
View file @
60adcbed
...
...
@@ -193,6 +193,12 @@ class SynapseRequest(Request):
self
.
finish_time
=
time
.
time
()
Request
.
connectionLost
(
self
,
reason
)
if
self
.
logcontext
is
None
:
logger
.
info
(
"
Connection from %s lost before request headers were read
"
,
self
.
client
)
return
# we only get here if the connection to the client drops before we send
# the response.
#
...
...
@@ -236,13 +242,6 @@ class SynapseRequest(Request):
def
_finished_processing
(
self
):
"""
Log the completion of this request and update the metrics
"""
if
self
.
logcontext
is
None
:
# this can happen if the connection closed before we read the
# headers (so render was never called). In that case we'll already
# have logged a warning, so just bail out.
return
usage
=
self
.
logcontext
.
get_resource_usage
()
if
self
.
_processing_finished_time
is
None
:
...
...
This diff is collapsed.
Click to expand it.
synapse/logging/context.py
+
5
−
0
View file @
60adcbed
...
...
@@ -539,6 +539,11 @@ def set_current_context(context: LoggingContextOrSentinel) -> LoggingContextOrSe
Returns:
The context that was previously active
"""
# everything blows up if we allow current_context to be set to None, so sanity-check
# that now.
if
context
is
None
:
raise
TypeError
(
"'
context
'
argument may not be None
"
)
current
=
current_context
()
if
current
is
not
context
:
...
...
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