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
fe1c1e6c
Unverified
Commit
fe1c1e6c
authored
5 years ago
by
Erik Johnston
Committed by
GitHub
5 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Fixup comments
Co-Authored-By:
Richard van der Hoff
<
1389908+richvdh@users.noreply.github.com
>
parent
59e0ed83
Branches
Branches containing commit
Tags
v1.103.0rc1
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
synapse/util/patch_inline_callbacks.py
+3
-3
3 additions, 3 deletions
synapse/util/patch_inline_callbacks.py
with
3 additions
and
3 deletions
synapse/util/patch_inline_callbacks.py
+
3
−
3
View file @
fe1c1e6c
...
@@ -114,7 +114,7 @@ def _check_yield_points(f: Callable, changes: List[str]):
...
@@ -114,7 +114,7 @@ def _check_yield_points(f: Callable, changes: List[str]):
"""
Wraps a generator that is about to be passed to defer.inlineCallbacks
"""
Wraps a generator that is about to be passed to defer.inlineCallbacks
checking that after every yield the log contexts are correct.
checking that after every yield the log contexts are correct.
Its perfectly valid for log contexts to change within a function, e.g. due
It
'
s perfectly valid for log contexts to change within a function, e.g. due
to new Measure blocks, so such changes are added to the given `changes`
to new Measure blocks, so such changes are added to the given `changes`
list instead of triggering an exception.
list instead of triggering an exception.
...
@@ -150,7 +150,7 @@ def _check_yield_points(f: Callable, changes: List[str]):
...
@@ -150,7 +150,7 @@ def _check_yield_points(f: Callable, changes: List[str]):
# final yield and returning. E.g. we forgot to yield on a
# final yield and returning. E.g. we forgot to yield on a
# function that returns a deferred.
# function that returns a deferred.
#
#
# We don't raise here as its perfectly valid for contexts to
# We don't raise here as it
'
s perfectly valid for contexts to
# change in a function, as long as it sets the correct context
# change in a function, as long as it sets the correct context
# on resolving (which is checked separately).
# on resolving (which is checked separately).
err
=
(
err
=
(
...
@@ -171,7 +171,7 @@ def _check_yield_points(f: Callable, changes: List[str]):
...
@@ -171,7 +171,7 @@ def _check_yield_points(f: Callable, changes: List[str]):
if
isinstance
(
d
,
defer
.
Deferred
)
and
not
d
.
called
:
if
isinstance
(
d
,
defer
.
Deferred
)
and
not
d
.
called
:
# This happens if we yield on a deferred that doesn't follow
# This happens if we yield on a deferred that doesn't follow
# the log context rules without wrappin in a `make_deferred_yieldable`.
# the log context rules without wrappin
g
in a `make_deferred_yieldable`.
# We raise here as this should never happen.
# We raise here as this should never happen.
if
LoggingContext
.
current_context
()
is
not
LoggingContext
.
sentinel
:
if
LoggingContext
.
current_context
()
is
not
LoggingContext
.
sentinel
:
err
=
(
err
=
(
...
...
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