#34870: Memory leak when using psycopg-c with django hstore
-------------------------------------+-------------------------------------
     Reporter:  David Burke          |                    Owner:  nobody
         Type:  Bug                  |                   Status:  closed
    Component:  Database layer       |                  Version:  4.2
  (models, ORM)                      |
     Severity:  Normal               |               Resolution:  invalid
     Keywords:                       |             Triage Stage:
                                     |  Unreviewed
    Has patch:  0                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------

Comment (by David Burke):

 Right. It seems odd to run the register function more than once.
 Stacktrace as requested.

 {{{
   File "/env/lib/python3.10/site-packages/celery/app/trace.py", line 477,
 in trace_task
     R = retval = fun(*args, **kwargs)
   File "/env/lib/python3.10/site-packages/celery/app/trace.py", line 760,
 in __protected_call__
     return self.run(*args, **kwargs)
   File "/memory_leak/tasks.py", line 9, in count_it
     User.objects.count()
   File "/env/lib/python3.10/site-packages/django/db/models/manager.py",
 line 87, in manager_method
     return getattr(self.get_queryset(), name)(*args, **kwargs)
   File "/env/lib/python3.10/site-packages/django/db/models/query.py", line
 608, in count
     return self.query.get_count(using=self.db)
   File "/env/lib/python3.10/site-packages/django/db/models/sql/query.py",
 line 568, in get_count
     return obj.get_aggregation(using, {"__count": Count("*")})["__count"]
   File "/env/lib/python3.10/site-packages/django/db/models/sql/query.py",
 line 554, in get_aggregation
     result = compiler.execute_sql(SINGLE)
   File "/env/lib/python3.10/site-
 packages/django/db/models/sql/compiler.py", line 1560, in execute_sql
     cursor = self.connection.cursor()
   File "/env/lib/python3.10/site-packages/django/utils/asyncio.py", line
 26, in inner
     return func(*args, **kwargs)
   File "/env/lib/python3.10/site-
 packages/django/db/backends/base/base.py", line 330, in cursor
     return self._cursor()
   File "/env/lib/python3.10/site-
 packages/django/db/backends/base/base.py", line 306, in _cursor
     self.ensure_connection()
   File "/env/lib/python3.10/site-packages/django/utils/asyncio.py", line
 26, in inner
     return func(*args, **kwargs)
   File "/env/lib/python3.10/site-
 packages/django/db/backends/base/base.py", line 289, in ensure_connection
     self.connect()
   File "/env/lib/python3.10/site-packages/django/utils/asyncio.py", line
 26, in inner
     return func(*args, **kwargs)
   File "/env/lib/python3.10/site-
 packages/django/db/backends/base/base.py", line 273, in connect
     connection_created.send(sender=self.__class__, connection=self)
   File "/env/lib/python3.10/site-packages/django/dispatch/dispatcher.py",
 line 176, in send
     return [
   File "/env/lib/python3.10/site-packages/django/dispatch/dispatcher.py",
 line 177, in <listcomp>
     (receiver, receiver(signal=self, sender=sender, **named))
   File "/env/lib/python3.10/site-
 packages/django/contrib/postgres/signals.py", line 43, in
 register_type_handlers
     raise Exception()
 }}}

-- 
Ticket URL: <https://code.djangoproject.com/ticket/34870#comment:7>
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/0107018ad1cae2f2-a4c77d93-c92b-40fa-9f1f-3a31723e6e88-000000%40eu-central-1.amazonses.com.

Reply via email to