mirror of
https://github.com/clearml/clearml
synced 2025-02-07 13:23:40 +00:00
Revert fork patching as signal is not enough and is not called from forked processes
This commit is contained in:
parent
5eb4ae6600
commit
3f6fb5379a
@ -69,17 +69,17 @@ class PatchOsFork(object):
|
||||
# Hack: now make sure we setup the reporter thread
|
||||
task._setup_reporter()
|
||||
|
||||
# TODO: Check if the signal handler method is enough, for the time being, disable the _exit hook
|
||||
# TODO: Check if the signal handler method is enough, for the time being, we have both
|
||||
# # if we got here patch the os._exit of our instance to call us
|
||||
# def _at_exit_callback(*args, **kwargs):
|
||||
# # call at exit manually
|
||||
# # noinspection PyProtectedMember
|
||||
# task._at_exit()
|
||||
# # noinspection PyProtectedMember
|
||||
# return os._org_exit(*args, **kwargs)
|
||||
#
|
||||
# if not hasattr(os, '_org_exit'):
|
||||
# os._org_exit = os._exit
|
||||
# os._exit = _at_exit_callback
|
||||
def _at_exit_callback(*args, **kwargs):
|
||||
# call at exit manually
|
||||
# noinspection PyProtectedMember
|
||||
task._at_exit()
|
||||
# noinspection PyProtectedMember
|
||||
return os._org_exit(*args, **kwargs)
|
||||
|
||||
if not hasattr(os, '_org_exit'):
|
||||
os._org_exit = os._exit
|
||||
os._exit = _at_exit_callback
|
||||
|
||||
return ret
|
||||
|
Loading…
Reference in New Issue
Block a user