Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
Elendiar opened this issue Oct 24, 2023 · 0 comments · Fixed by #692
Closed

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

Elendiar opened this issue Oct 24, 2023 · 0 comments · Fixed by #692

Comments

@Elendiar
Copy link

Elendiar commented Oct 24, 2023

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

python/cpython#110770 (comment)

@Elendiar Elendiar changed the title Python 3.12: ValueError: Another profiling tool is already active [Python 3.12] ValueError: Another profiling tool is already active Oct 24, 2023
mergify bot pushed a commit to hedyorg/hedy that referenced this issue Apr 4, 2024
Adds a sort of profiling to this page by placing some timers in some key function where I think the slowdown happens. Why is it so hacky? I tried for several hours to use werkzeug's `ProfilerMiddleware` but I think there's a bug with the implementation, as several people have reported in some other tools: django-commons/django-debug-toolbar#1875, jazzband/django-silk#682

I thought that since we didn't need the full-fledged tool and didn't want to spend more time on this, this approach would suffice.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant