Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Matrix
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Container Registry
Model registry
Operate
Environments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
TeDomum
Matrix
Commits
dd3df11c
Commit
dd3df11c
authored
8 years ago
by
Mark Haines
Browse files
Options
Downloads
Patches
Plain Diff
More logging for the linearizer and for get_events
parent
e1c5463e
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
synapse/storage/events.py
+2
-0
2 additions, 0 deletions
synapse/storage/events.py
synapse/util/async.py
+11
-2
11 additions, 2 deletions
synapse/util/async.py
with
13 additions
and
2 deletions
synapse/storage/events.py
+
2
−
0
View file @
dd3df11c
...
...
@@ -1084,8 +1084,10 @@ class EventsStore(SQLBaseStore):
self
.
_do_fetch
)
logger
.
info
(
"
Loading %d events
"
,
len
(
events
))
with
PreserveLoggingContext
():
rows
=
yield
events_d
logger
.
info
(
"
Loaded %d events (%d rows)
"
,
len
(
events
),
len
(
rows
))
if
not
allow_rejected
:
rows
[:]
=
[
r
for
r
in
rows
if
not
r
[
"
rejects
"
]]
...
...
This diff is collapsed.
Click to expand it.
synapse/util/async.py
+
11
−
2
View file @
dd3df11c
...
...
@@ -166,7 +166,11 @@ class Linearizer(object):
# do some work.
"""
def
__init__
(
self
):
def
__init__
(
self
,
name
=
None
):
if
name
is
None
:
self
.
name
=
id
(
self
)
else
:
self
.
name
=
name
self
.
key_to_defer
=
{}
@defer.inlineCallbacks
...
...
@@ -185,15 +189,20 @@ class Linearizer(object):
self
.
key_to_defer
[
key
]
=
new_defer
if
current_defer
:
logger
.
info
(
"
Waiting to acquire linearizer lock for key %r
"
,
key
)
logger
.
info
(
"
Waiting to acquire linearizer lock %r for key %r
"
,
self
.
name
,
key
)
with
PreserveLoggingContext
():
yield
current_defer
logger
.
info
(
"
Acquired linearizer lock %r for key %r
"
,
self
.
name
,
key
)
@contextmanager
def
_ctx_manager
():
try
:
yield
finally
:
logger
.
info
(
"
Releasing linearizer lock %r for key %r
"
,
self
.
name
,
key
)
new_defer
.
callback
(
None
)
current_d
=
self
.
key_to_defer
.
get
(
key
)
if
current_d
is
new_defer
:
...
...
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