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
b50e39df
Unverified
Commit
b50e39df
authored
3 years ago
by
Sean Quah
Committed by
GitHub
3 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Avoid waiting for zombie processes in `synctl stop` (#11490)
parent
858d80bf
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
changelog.d/11490.feature
+1
-0
1 addition, 0 deletions
changelog.d/11490.feature
synctl
+16
-3
16 additions, 3 deletions
synctl
with
17 additions
and
3 deletions
changelog.d/11490.feature
0 → 100644
+
1
−
0
View file @
b50e39df
`synctl
stop`
will
now
wait
for
Synapse
to
exit
before
returning.
This diff is collapsed.
Click to expand it.
synctl
+
16
−
3
View file @
b50e39df
...
@@ -41,11 +41,24 @@ NORMAL = "\x1b[m"
...
@@ -41,11 +41,24 @@ NORMAL = "\x1b[m"
def
pid_running
(
pid
):
def
pid_running
(
pid
):
try
:
try
:
os
.
kill
(
pid
,
0
)
os
.
kill
(
pid
,
0
)
return
True
except
OSError
as
err
:
except
OSError
as
err
:
if
err
.
errno
==
errno
.
EPERM
:
if
err
.
errno
==
errno
.
EPERM
:
return
True
pass
# process exists
return
False
else
:
return
False
# When running in a container, orphan processes may not get reaped and their
# PIDs may remain valid. Try to work around the issue.
try
:
with
open
(
f
"
/proc/
{
pid
}
/status
"
)
as
status_file
:
if
"
zombie
"
in
status_file
.
read
():
return
False
except
Exception
:
# This isn't Linux or `/proc/` is unavailable.
# Assume that the process is still running.
pass
return
True
def
write
(
message
,
colour
=
NORMAL
,
stream
=
sys
.
stdout
):
def
write
(
message
,
colour
=
NORMAL
,
stream
=
sys
.
stdout
):
...
...
This diff is collapsed.
Click to expand it.
Tulir Asokan
@tulir
mentioned in commit
158d73eb
·
3 years ago
mentioned in commit
158d73eb
mentioned in commit 158d73ebdd61eef33831ae5f6990acf07244fc55
Toggle commit list
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