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
dcca56ba
Commit
dcca56ba
authored
5 years ago
by
Richard van der Hoff
Browse files
Options
Downloads
Patches
Plain Diff
Add a delay to key lookup lock release to fix stack overflow
A tactical call_later here should fix #5723
parent
c7095be9
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
synapse/crypto/keyring.py
+8
-2
8 additions, 2 deletions
synapse/crypto/keyring.py
with
8 additions
and
2 deletions
synapse/crypto/keyring.py
+
8
−
2
View file @
dcca56ba
...
...
@@ -259,6 +259,10 @@ class Keyring(object):
# When we've finished fetching all the keys for a given server_name,
# drop the lock by resolving the deferred in key_downloads.
def
drop_server_lock
(
server_name
):
d
=
self
.
key_downloads
.
pop
(
server_name
)
d
.
callback
(
None
)
def
lookup_done
(
res
,
verify_request
):
server_name
=
verify_request
.
server_name
server_requests
=
server_to_request_ids
[
server_name
]
...
...
@@ -269,8 +273,10 @@ class Keyring(object):
with
PreserveLoggingContext
(
ctx
):
logger
.
debug
(
"
Releasing key lookup lock on %s
"
,
server_name
)
d
=
self
.
key_downloads
.
pop
(
server_name
)
d
.
callback
(
None
)
# ... but not immediately, as that can cause stack explosions if
# we get a long queue of lookups.
self
.
clock
.
call_later
(
0
,
drop_server_lock
,
server_name
)
return
res
for
verify_request
in
verify_requests
:
...
...
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