#35583: asgiref.sync.sync_to_async cannot be affected by close_old_connections
-------------------------------------+-------------------------------------
     Reporter:  Alexandr Onufrienko  |                    Owner:  (none)
         Type:  Bug                  |                   Status:  closed
    Component:  Database layer       |                  Version:
  (models, ORM)                      |
     Severity:  Normal               |               Resolution:  needsinfo
     Keywords:                       |             Triage Stage:
                                     |  Unreviewed
    Has patch:  0                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------
Changes (by Natalia Bidart):

 * cc: Carlton Gibson (added)
 * component:  Uncategorized => Database layer (models, ORM)
 * resolution:   => needsinfo
 * status:  new => closed
 * type:  Uncategorized => Bug

Comment:

 Hello Alexandr, thank you for your report.

 From the provided description, I can't quite understand the exact issue
 you are reporting. Could you please describe the use case and what you're
 trying to achieve in detail? This will help us understand the problem
 better and find the right solution.

 There are a few things to consider:

 1. When you said "''we have django command, that creates a "server" that
 listening for a message from queue, or periodically do some job''". This
 is in general against the recommended Django pattern for management
 commands. If you need to have a long running process, the ideal solution
 is to use a tool that integrates with Django and also provides the queue
 functionality such as Celery or any other task queue. See
 [https://forum.djangoproject.com/t/debugging-the-client-was-disconnected-
 by-the-server-because-of-inactivity/21730 this relevant discussion] or
 [https://forum.djangoproject.com/t/when-are-db-connections-closed/16347 or
 this one] in the Forum.

 2.  We would also need details about your database configuration
 (`CONN_MAX_AGE` specifically), Django version, etc. I have tried the code
 sample provided with a postgresql database and I don't get the error you
 have reported (I do get ''ResourceWarning: connection <psycopg.Connection
 [IDLE] ...> was deleted while still open. Please use 'with' or '.close()'
 to close the connection'').

 Initially I thought this could be similar to #31905 but after some further
 thinking I don't think it's the case.
-- 
Ticket URL: <https://code.djangoproject.com/ticket/35583#comment:2>
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/0107019093a3ad05-4db3a830-1210-4bd3-aa1f-5ef25b5b78cb-000000%40eu-central-1.amazonses.com.

Reply via email to