Skip to content

It doesnot count query while making query from another thread #932

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

Closed
amankumarjain opened this issue Apr 18, 2017 · 2 comments · Fixed by #1993
Closed

It doesnot count query while making query from another thread #932

amankumarjain opened this issue Apr 18, 2017 · 2 comments · Fixed by #1993

Comments

@amankumarjain
Copy link

How to debug database query when query is executed from separate thread.

@diegobill
Copy link

Same problem +1

@matthiask
Copy link
Member

This may be because Django ensures that all database connections are cursors differ between threads.

I think it may be very hard to implement cross-thread tracking of queries; there probably aren't easy ways to determine the originating thread in the general case; patching the threading module may work but maybe it won't. Also, the work would probably have to be redone for the async case. So, if anyone has a good idea how to implement this, please contribute (code or ideas) but for now I'm leaning towards closing this as not planned.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants