Hey,
This problem seems to be unique. There might not be a standard solution.

https://github.com/jazzband/django-silk

You can replicate the prod environment to local and profile it using django
silk.
If you can somehow manage to reproduce the bug and find the timestamp when
it happened;
you can find out the sql queries that were running around that timestamp.
You might be able to find out the root cause of the problem and fix it.

I am not 100% sure if it will help. But it is worth a try.
I hope it helps you.

Thanks!


Regards,
Chetan Ganji
+91-900-483-4183
ganji.che...@gmail.com
http://ryucoder.in


On Fri, Oct 27, 2023 at 9:50 PM Joshua Gardner <m...@jgardner.tech> wrote:

> I'm experiencing deadlocks in my production application occasionally. I'm
> using MySQL. Some of these deadlocks are due to insufficient indexing,
> and I'd like to fix this with some test-driven development.
>
> How can I write tests that exercise the application concurrently, and
> could be used to replicate the deadlocks and then fix them? I use
> pytest-django and I use MySQL in my tests; there's a lot of raw SQL and
> even some views and stored procedures (😱) in this application and some
> of those may be culprits too of course.
>
> I suppose my main question is "how to test bugs that occur due to
> concurrency?"
>
> -Josh
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/874jicca6t.fsf%40jgardner.tech
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAMKMUjsc60jBVaN35aTnRKDzf1LORBtiQ1Pn8pWsaW56KXn98g%40mail.gmail.com.

Reply via email to