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

toolbar can break on long running queries #327

Open
jvanasco opened this issue Jan 26, 2018 · 0 comments
Open

toolbar can break on long running queries #327

jvanasco opened this issue Jan 26, 2018 · 0 comments

Comments

@jvanasco
Copy link
Contributor

jvanasco commented Jan 26, 2018

A few PostgreSQL queries have timed out from being too long (45s+).

When this happens, trying to access the debugtoolbar BEFORE the request is killed will break the toolbar and generate a generic 'Internal Server Error' from waitress.

This is "secondarily" caused by exceptions raised in templates or panels due to the lack of proper variables in the environment. For example:

  • panels/performance.py will not have set self.total_time
  • panels/templates/headers.dbtmako doesn't have request_headers or response_headers

I'm not sure that the primary cause of this code even being executed is though. I think it may be because the request is added to the toolbar before it completes, but I'm not familiar with that part of the package. If that is the case, it may make sense to annotate the request with a 'completed' flag, and only run the panels on completed requests. This is just a wild guess though.

Edit:
This error happens when accessing the root/splash '/_debug_toolbar/' or a page that no longer exists and there is a long-running query. It does not happen when accessing a valid/completed request in the toolbar during the same long-running query.

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

No branches or pull requests

1 participant