Skip to content

Shutdown errors in dev #788

@lancetarn

Description

@lancetarn

Python 3.12, scout_apm_python 3.1.0
Looks like there are instances where the Core Agent doesn't quite shut down gracefully. I've seen this happen during server reloads as well as django-admin commands (which is probably a different question altogether). This might not be a problem, exactly, but it spews stacktraces.

Exception ignored in atexit callback: <function shutdown at 0x104ed9bc0>
Traceback (most recent call last):
  File "...lib/python3.12/site-packages/scout_apm/core/__init__.py", line 92, in shutdown
    CoreAgentSocketThread.wait_until_drained(
  File "...lib/python3.12/site-packages/scout_apm/core/agent/socket.py", line 62, in wait_until_drained
    cls.ensure_started()
  File "...lib/python3.12/site-packages/scout_apm/core/threading.py", line 23, in ensure_started
    cls._instance.start()
  File "...lib/python3.12/threading.py", line 992, in start
    _start_new_thread(self._bootstrap, ())
RuntimeError: can't create new thread at interpreter shutdown

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions