mirror of
https://github.com/clearml/clearml
synced 2025-04-26 17:30:20 +00:00
Fix "can't create new thread at interpreter shutdown" errors (known issue with Python 3.12.0 and other versions)
This commit is contained in:
parent
74b2b38673
commit
d75564d514
@ -527,6 +527,13 @@ class BackgroundMonitor(object):
|
|||||||
if isinstance(self._thread, Thread):
|
if isinstance(self._thread, Thread):
|
||||||
if self._thread_pid == os.getpid():
|
if self._thread_pid == os.getpid():
|
||||||
return
|
return
|
||||||
|
|
||||||
|
# make sure we start the metrics thread pools before starting the daemon thread
|
||||||
|
# workaround for: https://github.com/python/cpython/issues/113964
|
||||||
|
from ...backend_interface.metrics.interface import Metrics
|
||||||
|
# noinspection PyProtectedMember
|
||||||
|
Metrics._initialize_upload_pools()
|
||||||
|
|
||||||
self._thread_pid = os.getpid()
|
self._thread_pid = os.getpid()
|
||||||
self._thread = Thread(target=self._daemon)
|
self._thread = Thread(target=self._daemon)
|
||||||
self._thread.daemon = True
|
self._thread.daemon = True
|
||||||
|
Loading…
Reference in New Issue
Block a user