Re: deadlock risk from using cache a load time

2016-01-27 Thread Aymeric Augustin
> Le 27 janv. 2016 à 00:59, Tim Graham a écrit : > > Regarding the original issue -- in Claude's use case, he says that calling > django.setup() before unpickling is not doable, as an external tool is doing > the unpickling of model data. Should we say that unpickling model data from > non-Dja

Re: deadlock risk from using cache a load time

2016-01-26 Thread Tim Graham
Oops again... sorry for poor memory about the error message. Regarding the original issue -- in Claude's use case, he says that calling django.setup() before unpickling is not doable, as an external tool is doing the unpickling of model data. Should we say that unpickling model data from non-Dj

Re: deadlock risk from using cache a load time

2016-01-26 Thread Aymeric Augustin
On 26 janv. 2016, at 14:40, Tim Graham wrote: > Something like "Models aren't loaded yet. Are you missing django.setup() in a > standalone script?". We’ve had this discussion before, cf. 8121860be4b9379d107959290e5748bbaf6de1fe ;-) The exception message could point to the “Troubleshooting” s

Re: deadlock risk from using cache a load time

2016-01-26 Thread Tim Graham
Oops, here's the pull request: https://github.com/django/django/pull/6044 WIth the fix reverted and the missing django.setup() call, the exception is "django.core.exceptions.AppRegistryNotReady: Models aren't loaded yet.". I don't think we need a different exception in model_unpickle(), but mayb

Re: deadlock risk from using cache a load time

2016-01-26 Thread Aymeric Augustin
> On 26 janv. 2016, at 09:57, Florian Apolloner wrote: > > Revert yes, but a check like that should stay and maybe raise an error > instead of calling apps.populate. The following line, `apps.get_model(…)`, raises an exception when `not apps.models_ready`. -- Aymeric. -- You received th

Re: deadlock risk from using cache a load time

2016-01-26 Thread Florian Apolloner
On Tuesday, January 26, 2016 at 9:52:01 AM UTC+1, Aymeric Augustin wrote: > > However I think there's a bigger problem with this code. apps.populate() > should only be called by django.setup(). I think we should > revert 108b8bf852c76855ed98f5abe55db1da845598e7. > Revert yes, but a check like th

Re: deadlock risk from using cache a load time

2016-01-26 Thread Aymeric Augustin
> On 26 janv. 2016, at 00:43, John Bazik wrote: > > In db/models/base.py, in model_unpickle, I see this: > > if isinstance(model_id, tuple): > if not apps.ready: > apps.populate(settings.INSTALLED_APPS) > model = apps.get_model(*model_id) > > Can that test instea

Re: deadlock risk from using cache a load time

2016-01-25 Thread John Bazik
I got a patch from the django-cms folks that moves template loading into their AppConfig.ready() routine, but the problem persists. The last few lines of apps.populate are: self.models_ready = True for app_config in self.get_app_configs(): app_config.read

Re: deadlock risk from using cache a load time

2016-01-13 Thread John Bazik
> I wouldn't call multisite/hacks.py reasonable :D That said, unpickling > models requires apps to be populated (relations etc…), therefor do not > attempt to do such an action during population. > Thanks. Shai offered the same opinion and I'm following up with the django-cms developers. Jo

Re: deadlock risk from using cache a load time

2016-01-13 Thread Florian Apolloner
On Wednesday, January 13, 2016 at 6:58:25 PM UTC+1, John Bazik wrote: > > I'm posting here because I think the problem is principally within django > - the apps I'm using are doing reasonable things. > I wouldn't call multisite/hacks.py reasonable :D That said, unpickling models requires apps