Sentry "RuntimeError: can't create new thread at interpreter shutdown"

$ kcidb_build append-dict misc/provenance function="executor" url="${CI_JOB_URL}" service_name="gitlab"
Exception ignored in atexit callback: <function AtexitIntegration.setup_once.<locals>._shutdown at 0x7fa77fa24e00>
Traceback (most recent call last):
  File "/builds/4704997395/software/venv/lib64/python3.12/site-packages/sentry_sdk/integrations/atexit.py", line 61, in _shutdown
    client.close(callback=integration.callback)
  File "/builds/4704997395/software/venv/lib64/python3.12/site-packages/sentry_sdk/client.py", line 580, in close
    self.flush(timeout=timeout, callback=callback)
  File "/builds/4704997395/software/venv/lib64/python3.12/site-packages/sentry_sdk/client.py", line 604, in flush
    self.transport.flush(timeout=timeout, callback=callback)
  File "/builds/4704997395/software/venv/lib64/python3.12/site-packages/sentry_sdk/transport.py", line 525, in flush
    self._worker.submit(lambda: self._flush_client_reports(force=True))
  File "/builds/4704997395/software/venv/lib64/python3.12/site-packages/sentry_sdk/worker.py", line 117, in submit
    self._ensure_thread()
  File "/builds/4704997395/software/venv/lib64/python3.12/site-packages/sentry_sdk/worker.py", line 42, in _ensure_thread
    self.start()
  File "/builds/4704997395/software/venv/lib64/python3.12/site-packages/sentry_sdk/worker.py", line 70, in start
    self._thread.start()
  File "/builds/4704997395/software/venv/lib64/python3.12/site-packages/sentry_sdk/integrations/threading.py", line 56, in sentry_start
    return old_start(self, *a, **kw)
           ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib64/python3.12/threading.py", line 971, in start
    _start_new_thread(self._bootstrap, ())
RuntimeError: can't create new thread at interpreter shutdown

For example: https://gitlab.com/redhat/red-hat-ci-tools/kernel/cki-internal-pipelines/cki-trusted-contributors/-/jobs/4705711332

Edited by Tales da Aparecida