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
Container Registry
Model registry
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
Maunium
synapse
Commits
80a992d7
Unverified
Commit
80a992d7
authored
4 years ago
by
Erik Johnston
Committed by
GitHub
4 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Fix deadlock on SIGHUP (#8918)
Fixes #8892
parent
c64002e1
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
changelog.d/8918.bugfix
+1
-0
1 addition, 0 deletions
changelog.d/8918.bugfix
synapse/app/_base.py
+5
-1
5 additions, 1 deletion
synapse/app/_base.py
with
6 additions
and
1 deletion
changelog.d/8918.bugfix
0 → 100644
+
1
−
0
View file @
80a992d7
Fix occasional deadlock when handling SIGHUP.
This diff is collapsed.
Click to expand it.
synapse/app/_base.py
+
5
−
1
View file @
80a992d7
...
@@ -245,6 +245,8 @@ def start(hs: "synapse.server.HomeServer", listeners: Iterable[ListenerConfig]):
...
@@ -245,6 +245,8 @@ def start(hs: "synapse.server.HomeServer", listeners: Iterable[ListenerConfig]):
# Set up the SIGHUP machinery.
# Set up the SIGHUP machinery.
if
hasattr
(
signal
,
"
SIGHUP
"
):
if
hasattr
(
signal
,
"
SIGHUP
"
):
reactor
=
hs
.
get_reactor
()
@wrap_as_background_process
(
"
sighup
"
)
@wrap_as_background_process
(
"
sighup
"
)
def
handle_sighup
(
*
args
,
**
kwargs
):
def
handle_sighup
(
*
args
,
**
kwargs
):
# Tell systemd our state, if we're using it. This will silently fail if
# Tell systemd our state, if we're using it. This will silently fail if
...
@@ -260,7 +262,9 @@ def start(hs: "synapse.server.HomeServer", listeners: Iterable[ListenerConfig]):
...
@@ -260,7 +262,9 @@ def start(hs: "synapse.server.HomeServer", listeners: Iterable[ListenerConfig]):
# is so that we're in a sane state, e.g. flushing the logs may fail
# is so that we're in a sane state, e.g. flushing the logs may fail
# if the sighup happens in the middle of writing a log entry.
# if the sighup happens in the middle of writing a log entry.
def
run_sighup
(
*
args
,
**
kwargs
):
def
run_sighup
(
*
args
,
**
kwargs
):
hs
.
get_clock
().
call_later
(
0
,
handle_sighup
,
*
args
,
**
kwargs
)
# `callFromThread` should be "signal safe" as well as thread
# safe.
reactor
.
callFromThread
(
handle_sighup
,
*
args
,
**
kwargs
)
signal
.
signal
(
signal
.
SIGHUP
,
run_sighup
)
signal
.
signal
(
signal
.
SIGHUP
,
run_sighup
)
...
...
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