mirror of
https://github.com/clearml/clearml-agent
synced 2025-05-03 19:51:57 +00:00
Fix services mode killing child processes when running in services mode + venv
This commit is contained in:
parent
b48f25a7f9
commit
382604e923
@ -1456,15 +1456,15 @@ class Worker(ServiceCommandSection):
|
|||||||
stop_reason = TaskStopReason.exception
|
stop_reason = TaskStopReason.exception
|
||||||
status = -1
|
status = -1
|
||||||
|
|
||||||
# full cleanup (just in case)
|
|
||||||
if process:
|
|
||||||
kill_all_child_processes(process.pid)
|
|
||||||
|
|
||||||
# if running in services mode, keep the file open
|
# if running in services mode, keep the file open
|
||||||
# in case the docker was so quick it started and finished, check the stop reason
|
# in case the docker was so quick it started and finished, check the stop reason
|
||||||
if self._services_mode and service_mode_internal_agent_started and stop_reason == 'Service started':
|
if self._services_mode and service_mode_internal_agent_started and stop_reason == 'Service started':
|
||||||
return None, None
|
return None, None
|
||||||
|
|
||||||
|
# full cleanup (just in case)
|
||||||
|
if process and not self._services_mode:
|
||||||
|
kill_all_child_processes(process.pid)
|
||||||
|
|
||||||
stdout.close()
|
stdout.close()
|
||||||
if stderr_path:
|
if stderr_path:
|
||||||
stderr.close()
|
stderr.close()
|
||||||
|
Loading…
Reference in New Issue
Block a user