Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
OpenDAS
dynamo
Commits
a9c0e0c7
Unverified
Commit
a9c0e0c7
authored
Jul 07, 2025
by
Neelay Shah
Committed by
GitHub
Jul 07, 2025
Browse files
fix: for handling zombie process (#1801)
parent
c9a60278
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
13 deletions
+24
-13
tests/utils/managed_process.py
tests/utils/managed_process.py
+24
-13
No files found.
tests/utils/managed_process.py
View file @
a9c0e0c7
...
...
@@ -140,7 +140,7 @@ class ManagedProcess:
cmdline
,
)
terminate_process_tree
(
ps_process
.
pid
,
self
.
_logger
)
except
(
psutil
.
NoSuchProcess
,
psutil
.
AccessDenied
):
except
(
psutil
.
NoSuchProcess
,
psutil
.
AccessDenied
,
psutil
.
ZombieProcess
):
# Process may have terminated or become inaccessible during iteration
pass
...
...
@@ -256,21 +256,32 @@ class ManagedProcess:
def
_terminate_existing
(
self
):
if
self
.
terminate_existing
:
for
proc
in
psutil
.
process_iter
([
"name"
,
"cmdline"
]):
if
proc
.
name
()
==
self
.
_command_name
or
proc
.
name
()
in
self
.
stragglers
:
self
.
_logger
.
info
(
"Terminating Existing %s %s"
,
proc
.
name
(),
proc
.
pid
)
terminate_process_tree
(
proc
.
pid
,
self
.
_logger
)
for
cmdline
in
self
.
straggler_commands
:
if
cmdline
in
" "
.
join
(
proc
.
cmdline
()):
try
:
if
(
proc
.
name
()
==
self
.
_command_name
or
proc
.
name
()
in
self
.
stragglers
):
self
.
_logger
.
info
(
"Terminating Existing CmdLine %s %s %s"
,
proc
.
name
(),
proc
.
pid
,
proc
.
cmdline
(),
"Terminating Existing %s %s"
,
proc
.
name
(),
proc
.
pid
)
terminate_process_tree
(
proc
.
pid
,
self
.
_logger
)
for
cmdline
in
self
.
straggler_commands
:
if
cmdline
in
" "
.
join
(
proc
.
cmdline
()):
self
.
_logger
.
info
(
"Terminating Existing CmdLine %s %s %s"
,
proc
.
name
(),
proc
.
pid
,
proc
.
cmdline
(),
)
terminate_process_tree
(
proc
.
pid
,
self
.
_logger
)
except
(
psutil
.
NoSuchProcess
,
psutil
.
AccessDenied
,
psutil
.
ZombieProcess
,
):
# Process may have terminated or become inaccessible during iteration
pass
def
main
():
...
...
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