Skip to content

RuntimeError: can't create new thread at interpreter shutdownΒ #4752

@emdneto

Description

@emdneto

Describe your environment

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

Steps to Reproduce

  1. Run the example here with python 3.12.0

Expected Result

No RuntimeError

Actual Result

RuntimeError

Additional context

Got this after this PR

Probably due to: python/cpython#113964

Would you like to implement a fix?

None

Tip

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions