jazzband / django-silk

Silky smooth profiling for Django
MIT License
4.32k stars 332 forks source link

[Python 3.12] ValueError: Another profiling tool is already active #682

Closed Elendiar closed 6 months ago

Elendiar commented 8 months ago

In python 3.12 sometimes this exception raises, usually immediately after the server starts in the first request. SILKY_PYTHON_PROFILER = False seems to fix it.

File "/backend/python/lib/python3.12/site-packages/django/core/handlers/exception.py", line 55, in inner
  response = get_response(request)

File "/backend/python/lib/python3.12/site-packages/silk/middleware.py", line 70, in __call__
  self.process_request(request)

File "/backend/python/lib/python3.12/site-packages/silk/middleware.py", line 121, in process_request
  DataCollector().configure(request_model, should_profile=should_profile)

File "/backend/python/lib/python3.12/site-packages/silk/collector.py", line 95, in configure
  self.local.pythonprofiler.enable()
ValueError: Another profiling tool is already active

https://github.com/python/cpython/issues/110770#issuecomment-1759986100