Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
flamenco-worker-python
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
blender
flamenco-worker-python
Commits
f57d6f3f
Commit
f57d6f3f
authored
Jun 14, 2018
by
Sybren A. Stüvel
Browse files
Options
Downloads
Patches
Plain Diff
When aborting a subprocess, try to terminate it before killing it
parent
9f48c59b
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
CHANGELOG.md
+1
-0
1 addition, 0 deletions
CHANGELOG.md
flamenco_worker/commands.py
+23
-2
23 additions, 2 deletions
flamenco_worker/commands.py
with
24 additions
and
2 deletions
CHANGELOG.md
+
1
−
0
View file @
f57d6f3f
...
@@ -10,6 +10,7 @@ changed functionality, fixed bugs).
...
@@ -10,6 +10,7 @@ changed functionality, fixed bugs).
-
Include
`exr-merge`
task type in default configuration, which is required for progressive
-
Include
`exr-merge`
task type in default configuration, which is required for progressive
rendering.
rendering.
-
Prevent outgoing queue saturation by not fetching a new task when the queue is too large.
-
Prevent outgoing queue saturation by not fetching a new task when the queue is too large.
-
When aborting a subprocess, try to terminate it before killing it.
-
Changed some of the configuration defaults to more sensible values (mostly queueing up larger
-
Changed some of the configuration defaults to more sensible values (mostly queueing up larger
amounts of logs before pushing to Flamenco Manager).
amounts of logs before pushing to Flamenco Manager).
...
...
This diff is collapsed.
Click to expand it.
flamenco_worker/commands.py
+
23
−
2
View file @
f57d6f3f
...
@@ -459,11 +459,32 @@ class AbstractSubprocessCommand(AbstractCommand):
...
@@ -459,11 +459,32 @@ class AbstractSubprocessCommand(AbstractCommand):
self
.
_log
.
debug
(
"
No process to kill. That
'
s ok.
"
)
self
.
_log
.
debug
(
"
No process to kill. That
'
s ok.
"
)
return
return
self
.
_log
.
info
(
'
Aborting subprocess
'
)
self
.
_log
.
info
(
'
Terminating subprocess
'
)
try
:
self
.
proc
.
terminate
()
except
ProcessLookupError
:
self
.
_log
.
debug
(
"
The process was already stopped, aborting is impossible. That
'
s ok.
"
)
return
except
AttributeError
:
# This can happen in some race conditions, it's fine.
self
.
_log
.
debug
(
"
The process was not yet started, aborting is impossible. That
'
s ok.
"
)
return
timeout
=
5
try
:
retval
=
await
asyncio
.
wait_for
(
self
.
proc
.
wait
(),
timeout
,
loop
=
asyncio
.
get_event_loop
())
except
asyncio
.
TimeoutError
:
pass
else
:
self
.
_log
.
info
(
'
The process aborted with status code %s
'
,
retval
)
return
self
.
_log
.
warning
(
'
The process did not stop in %d seconds, going to kill it
'
,
timeout
)
try
:
try
:
self
.
proc
.
kill
()
self
.
proc
.
kill
()
except
ProcessLookupError
:
except
ProcessLookupError
:
# The process is already stopped, so killing is impossible. That's ok.
self
.
_log
.
debug
(
"
The process was already stopped, aborting is impossible. That
'
s ok.
"
)
self
.
_log
.
debug
(
"
The process was already stopped, aborting is impossible. That
'
s ok.
"
)
return
return
except
AttributeError
:
except
AttributeError
:
...
...
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