#6237 (restore.py fails saying "More than 1000 deferred objects")
by Luc Saffre · in Developers · assigned to Luc Saffre
Kokkuvõte
It is caused by a circular dependency during dump2py when User.current_order is not empty.
Children
Kommentaarid
- 1 aasta, 2 kuud ago by Luc Saffre about #6237 (restore.py fails saying "More than 1000 deferred objects") : This issue had been triggered by #6201 (Default values for "Team" and "Subscription" of new tickets).
- 1 aasta, 2 kuud ago by Luc Saffre about #6237 (restore.py fails saying "More than 1000 deferred objects") : Seems that my plan works, and the test suite passes on my machine.
- 1 aasta, 2 kuud ago by Luc Saffre about #6237 (restore.py fails saying "More than 1000 deferred objects") : My first plan for fixing the problem is this: when a database row fails to save during restore.py, Lino can look whether it has nullable FK fields that aren't null, set these to None and try to save it again.
- 1 aasta, 2 kuud ago by Luc Saffre about #6237 (restore.py fails saying "More than 1000 deferred objects") : I published my changes so far, which are just preparing the coup (the ddt in noi1e is marked as SKIP because the problem isn't fixed).
- 1 aasta, 2 kuud ago by Luc Saffre about #6237 (restore.py fails saying "More than 1000 deferred objects") : I added a new demo project "circular", which reproduces what happened on Jane, but in much simpler constellation.
- 1 aasta, 2 kuud ago by Luc Saffre about #6237 (restore.py fails saying "More than 1000 deferred objects") : I increased max_deferred_objects from 1000 to 4000, and dump2py now sorts the models with unresolved dependencies by the number of rows. But even then it "Abandoning with 2882 unsaved instances". Which shows that the new field User.current_order indeed introduces a kind of deadlock.
- 1 aasta, 2 kuud ago by Luc Saffre about #6237 (restore.py fails saying "More than 1000 deferred objects") : Before even thinking about how exactly to fix this issue, I want to cover it by our test suite. I wrote a django-admin command ddt.
- 1 aasta, 2 kuud ago by Luc Saffre about #6237 (restore.py fails saying "More than 1000 deferred objects") : dump2py in noi1e says "There are 39 models with circular dependencies". Until now we ignored this because the deserializer stores failures as "deferred objects" and tries to save them again and again, until it passes. But now it reached the hard-coded limit of 1000 deferred objects.
- 1 aasta, 2 kuud ago by Luc Saffre about #6237 (restore.py fails saying "More than 1000 deferred objects") : I added demo data in order to reproduce the issue in noi1e.
- 1 aasta, 2 kuud ago by Luc Saffre about #6237 (restore.py fails saying "More than 1000 deferred objects") : Created new Ticket #6237 (Circular dependency during dump2py causes restore.py to fail).