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
1579fdd5
Unverified
Commit
1579fdd5
authored
3 years ago
by
Erik Johnston
Committed by
GitHub
3 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Ensure we always drop the federation inbound lock (#10336)
parent
974261cd
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/10336.bugfix
+1
-0
1 addition, 0 deletions
changelog.d/10336.bugfix
synapse/federation/federation_server.py
+1
-0
1 addition, 0 deletions
synapse/federation/federation_server.py
synapse/storage/databases/main/lock.py
+13
-2
13 additions, 2 deletions
synapse/storage/databases/main/lock.py
with
15 additions
and
2 deletions
changelog.d/10336.bugfix
0 → 100644
+
1
−
0
View file @
1579fdd5
Fix bug where inbound federation in a room could be delayed due to not correctly dropping a lock. Introduced in v1.37.1.
This diff is collapsed.
Click to expand it.
synapse/federation/federation_server.py
+
1
−
0
View file @
1579fdd5
...
@@ -949,6 +949,7 @@ class FederationServer(FederationBase):
...
@@ -949,6 +949,7 @@ class FederationServer(FederationBase):
room_id
,
room_version
room_id
,
room_version
)
)
if
not
next
:
if
not
next
:
await
lock
.
release
()
return
return
origin
,
event
=
next
origin
,
event
=
next
...
...
This diff is collapsed.
Click to expand it.
synapse/storage/databases/main/lock.py
+
13
−
2
View file @
1579fdd5
...
@@ -310,14 +310,25 @@ class Lock:
...
@@ -310,14 +310,25 @@ class Lock:
_excinst
:
Optional
[
BaseException
],
_excinst
:
Optional
[
BaseException
],
_exctb
:
Optional
[
TracebackType
],
_exctb
:
Optional
[
TracebackType
],
)
->
bool
:
)
->
bool
:
await
self
.
release
()
return
False
async
def
release
(
self
)
->
None
:
"""
Release the lock.
This is automatically called when using the lock as a context manager.
"""
if
self
.
_dropped
:
return
if
self
.
_looping_call
.
running
:
if
self
.
_looping_call
.
running
:
self
.
_looping_call
.
stop
()
self
.
_looping_call
.
stop
()
await
self
.
_store
.
_drop_lock
(
self
.
_lock_name
,
self
.
_lock_key
,
self
.
_token
)
await
self
.
_store
.
_drop_lock
(
self
.
_lock_name
,
self
.
_lock_key
,
self
.
_token
)
self
.
_dropped
=
True
self
.
_dropped
=
True
return
False
def
__del__
(
self
)
->
None
:
def
__del__
(
self
)
->
None
:
if
not
self
.
_dropped
:
if
not
self
.
_dropped
:
# We should not be dropped without the lock being released (unless
# We should not be dropped without the lock being released (unless
...
...
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