[Django] #29321: when instance.delete() while cause memory leak

8 views
Skip to first unread message

Django

unread,
Apr 12, 2018, 9:46:07 PM4/12/18
to django-...@googlegroups.com
#29321: when instance.delete() while cause memory leak
-----------------------------------------+------------------------
Reporter: yywing | Owner: nobody
Type: Bug | Status: new
Component: Uncategorized | Version: 2.0
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
-----------------------------------------+------------------------
{{{
class A(models.Model):
xxxxxxx
class B(models.Model):
a = models.ForeignKey(A, on_delete=models.CASCADE)
xxxxx
class C(models.Model):
b = models.ForeignKey(B, on_delete=models.CASCADE)
xxxxxx
A.objects.first().delete()
}}}
When I delete an instance of A, if A has is related with many B and B is
related with many C, then it will cause memory leak.
And I found django on_delete has no effect at SQL level.
And I really want that when I delete A ,related B is deleted.

--
Ticket URL: <https://code.djangoproject.com/ticket/29321>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Apr 12, 2018, 9:50:41 PM4/12/18
to django-...@googlegroups.com
#29321: when instance.delete() while cause memory leak
-------------------------------------+-------------------------------------

Reporter: yywing | Owner: nobody
Type: Bug | Status: new
Component: Database layer | Version: 2.0
(models, ORM) |
Severity: Normal | Resolution:

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 yywing):

* component: Uncategorized => Database layer (models, ORM)


--
Ticket URL: <https://code.djangoproject.com/ticket/29321#comment:1>

Django

unread,
Apr 13, 2018, 12:29:39 PM4/13/18
to django-...@googlegroups.com
#29321: when instance.delete() while cause memory leak
-------------------------------------+-------------------------------------

Reporter: yywing | Owner: nobody
Type: Bug | Status: new
Component: Database layer | Version: 2.0
(models, ORM) |
Severity: Normal | Resolution:
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 Tim Graham):

Can you elaborate on the details of the memory leak?

Database-level cascade is the subject of #21961.

--
Ticket URL: <https://code.djangoproject.com/ticket/29321#comment:2>

Django

unread,
Apr 14, 2018, 5:03:02 PM4/14/18
to django-...@googlegroups.com
#29321: when instance.delete() while cause memory leak
-------------------------------------+-------------------------------------
Reporter: yywing | Owner: nobody
Type: Bug | Status: closed

Component: Database layer | Version: 2.0
(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 Tim Graham):

* status: new => closed
* resolution: => needsinfo


--
Ticket URL: <https://code.djangoproject.com/ticket/29321#comment:3>

Reply all
Reply to author
Forward
0 new messages