#31515: Django tries to reuse MySQL connections that have gone away with ASGI.
---------------------------------+------------------------------------
Reporter: Braunson | Owner: nobody
Type: Bug | Status: new
Component: Documentation | Version: 3.0
Severity: Release blocker | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
---------------------------------+------------------------------------
Comment (by Braunson):
Replying to [comment:20 Andrew Godwin]:
> Well, we would have to find exactly where the bug is first before fixing
it. Nothing I know of in my quick glance through the code made it obvious
where it could be; we seem to correctly handle the `close_old_connections`
call even in Django 3.0 ASGI mode (not calling `close_old_connections` is
often the cause of this bug).
>
> I never figured out why during Channels development, but the MySQL
backend seems specifically prone to these sorts of issues even when it
should be fine. I think if you set a non-zero CONN_MAX_AGE it should clear
itself up, if you can take that operationally, otherwise I think you may
have to run on WSGI rather than ASGI for now (unless we track down exactly
what is doing this)
I did actually try setting a non-zero `CONN_MAX_AGE` but the issue
persists. And unfortunately we developed some features that rely on ASGI
due to using async third party libraries.
--
Ticket URL: <https://code.djangoproject.com/ticket/31515#comment:21>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/067.419fd878e9b9ba5f39fbe8adbc1fd7f7%40djangoproject.com.