mirror of
https://github.com/clearml/clearml
synced 2025-02-23 12:50:17 +00:00
Fix Process Pool hangs at exit (#674)
This commit is contained in:
parent
72eb59c9ca
commit
ab2ab50e4c
@ -1,4 +1,5 @@
|
|||||||
import os
|
import os
|
||||||
|
from time import sleep
|
||||||
|
|
||||||
import six
|
import six
|
||||||
|
|
||||||
@ -106,7 +107,7 @@ class PatchOsFork(object):
|
|||||||
# just make sure we flush the internal state (the at exist caught by the external signal does the rest
|
# just make sure we flush the internal state (the at exist caught by the external signal does the rest
|
||||||
# in theory we should not have to do any of that, but for some reason if we do not
|
# in theory we should not have to do any of that, but for some reason if we do not
|
||||||
# the signal is never caught by the signal call backs, not sure why....
|
# the signal is never caught by the signal call backs, not sure why....
|
||||||
|
sleep(0.1)
|
||||||
# Since at_exist handlers do not work on forked processes, we have to manually call them here
|
# Since at_exist handlers do not work on forked processes, we have to manually call them here
|
||||||
if task:
|
if task:
|
||||||
try:
|
try:
|
||||||
|
@ -3460,6 +3460,7 @@ class Task(_Task):
|
|||||||
elif task_status[0] == 'failed':
|
elif task_status[0] == 'failed':
|
||||||
self.mark_failed(status_reason=task_status[1])
|
self.mark_failed(status_reason=task_status[1])
|
||||||
elif task_status[0] == 'completed':
|
elif task_status[0] == 'completed':
|
||||||
|
self.set_progress(100)
|
||||||
self.mark_completed()
|
self.mark_completed()
|
||||||
elif task_status[0] == 'stopped':
|
elif task_status[0] == 'stopped':
|
||||||
self.stopped()
|
self.stopped()
|
||||||
@ -3497,9 +3498,6 @@ class Task(_Task):
|
|||||||
pass
|
pass
|
||||||
self._edit_lock = None
|
self._edit_lock = None
|
||||||
|
|
||||||
if task_status and task_status[0] == "completed":
|
|
||||||
self.set_progress(100)
|
|
||||||
|
|
||||||
# make sure no one will re-enter the shutdown method
|
# make sure no one will re-enter the shutdown method
|
||||||
self._at_exit_called = True
|
self._at_exit_called = True
|
||||||
if not is_sub_process and BackgroundMonitor.is_subprocess_enabled():
|
if not is_sub_process and BackgroundMonitor.is_subprocess_enabled():
|
||||||
|
@ -1 +1 @@
|
|||||||
__version__ = '1.4.0'
|
__version__ = '1.4.1'
|
||||||
|
Loading…
Reference in New Issue
Block a user