You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
RuntimeError: can't create new thread at interpreter shutdown #4752
OS: Ubuntu
Python version: 3.12.0, 3.12.1, 3.12.2
SDK version: Since 1.36.0
API version: Since 1.36.0
What happened?
Exception ignored in atexit callback: <function shutdown at 0x72be9c2a93a0>
Traceback (most recent call last):
File "/home/codespace/.python/current/lib/python3.12/logging/__init__.py", line 2271, in shutdown
h.flush()
File "/workspaces/opentelemetry-python/opentelemetry-sdk/src/opentelemetry/sdk/_logs/_internal/__init__.py", line 654, in flush
thread.start()
File "/home/codespace/.python/current/lib/python3.12/threading.py", line 992, in start
_start_new_thread(self._bootstrap, ())
RuntimeError: can't create new thread at interpreter shutdown
React with 👍 to help prioritize this issue. Please use comments to provide useful context, avoiding +1 or me too, to help us triage it. Learn more here.
Activity
emdneto commentedon Sep 16, 2025
From python >=3.12.3 there's no issue. it seems the issue happens with python 3.12.0, 3.12.1 and 3.12.2
aabmass commentedon Oct 9, 2025
Is this WAI @emdneto ? Last time I looked at this the CPython bugs insisted this is the expected behavior
emdneto commentedon Dec 24, 2025
Hey @aabmass, sorry, I missed this.
It seems so, but we still see the RuntimeError on our end. AFAICS, people are catching the error and suppressing it as a workaround.
fix(sdk): handle RuntimeError during LoggingHandler.flush at shutdown
fix(sdk): handle RuntimeError during LoggingHandler.flush at shutdown