Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Hamza
erp5
Commits
2e8be7fc
Commit
2e8be7fc
authored
Oct 07, 2019
by
Sebastien Robin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
testnode: avoid testnode crash when trying to kill a process already dead
parent
ddab98f9
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
3 deletions
+6
-3
erp5/util/testnode/ProcessManager.py
erp5/util/testnode/ProcessManager.py
+6
-3
No files found.
erp5/util/testnode/ProcessManager.py
View file @
2e8be7fc
...
@@ -110,10 +110,10 @@ def killCommand(pid):
...
@@ -110,10 +110,10 @@ def killCommand(pid):
try
:
try
:
process
=
psutil
.
Process
(
pid
)
process
=
psutil
.
Process
(
pid
)
process
.
suspend
()
process
.
suspend
()
except
psutil
.
Error
as
e
:
return
process_list
=
[
process
]
process_list
=
[
process
]
new_list
=
process
.
children
(
recursive
=
True
)
new_list
=
process
.
children
(
recursive
=
True
)
except
psutil
.
Error
as
e
:
return
while
new_list
:
while
new_list
:
process_list
+=
new_list
process_list
+=
new_list
for
child
in
new_list
:
for
child
in
new_list
:
...
@@ -122,7 +122,10 @@ def killCommand(pid):
...
@@ -122,7 +122,10 @@ def killCommand(pid):
except
psutil
.
Error
as
e
:
except
psutil
.
Error
as
e
:
logger
.
debug
(
"killCommand/suspend: %s"
,
e
)
logger
.
debug
(
"killCommand/suspend: %s"
,
e
)
time
.
sleep
(
1
)
time
.
sleep
(
1
)
try
:
new_list
=
set
(
process
.
children
(
recursive
=
True
)).
difference
(
process_list
)
new_list
=
set
(
process
.
children
(
recursive
=
True
)).
difference
(
process_list
)
except
psutil
.
Error
as
e
:
new_list
=
[]
for
process
in
process_list
:
for
process
in
process_list
:
try
:
try
:
process
.
kill
()
process
.
kill
()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment