deadlock at load time from register_plugin

41 views
Skip to first unread message

John Bazik

unread,
Jan 13, 2016, 3:18:35 PM1/13/16
to django CMS developers
I'm experiencing deadlock at load time (python manage.py help) due to a nested call to apps.populate in django 1.8.7 and django-cms 3.2.0.  It was suggested to me that the problem lies with register_plugin, which loads templates; that since django 1.7, that should happen in AppConfig.ready().

The detailed description of my problem and responses are here:

https://groups.google.com/forum/#!topic/django-users/WiRzQ8EFOdo

John

John Bazik

unread,
Jan 21, 2016, 5:26:02 PM1/21/16
to django CMS developers
Hey, so, in that other thread, Shai (of django-dev) said:

> I have never used Django-CMS, but according to your description, it (or its plugins) is doing what
> applications should avoid doing since Django 1.7 and the app-loading refactor. Registrations which
> involve interactions with applications -- and loading templates falls under this definition -- should
> happen only in an app's AppConfig.ready(), after all the models are already loaded.

The problem is in plugin_pool.register_plugin.  In validating the plugin, it invokes the template
loader stack, and if any third party loaders are in there, they can, for instance (in my case)
attempt to retrieve a model from cache before all the models are loaded.

If you agree that this is a problem, how about splitting registration and validation of plugins and
doing the former at load time and the latter in cms.apps.CMSConfig.ready()?  I can offer a patch
if you're okay with the concept.

John

Iacopo Spalletti

unread,
Jan 23, 2016, 4:57:35 AM1/23/16
to django-cms...@googlegroups.com
Thanks for the time investigating this.
Given that I overlooked that part when doing the 1.7 migration, I guess
it's up to me to fix this :)
See https://github.com/divio/django-cms/pull/4946

Tests may fail due to unrelated change in classytags. The code being the
same in 3.1/3.2 I opened PR on 3.1, but it should apply cleanly on 3.2 too

>
> John
>
> --
> Message URL:
> https://groups.google.com/d/msg/django-cms-developers/topic-id/message-id
> Unsubscribe: send a message to
> django-cms-devel...@googlegroups.com
> ---
> You received this message because you are subscribed to the Google
> Groups "django CMS developers" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to django-cms-devel...@googlegroups.com
> <mailto:django-cms-devel...@googlegroups.com>.
> To view this discussion on the web, visit
> https://groups.google.com/d/msgid/django-cms-developers/83be595a-acbf-4b99-8d08-3374455b92b6%40googlegroups.com
> <https://groups.google.com/d/msgid/django-cms-developers/83be595a-acbf-4b99-8d08-3374455b92b6%40googlegroups.com?utm_medium=email&utm_source=footer>.
> For more options, visit https://groups.google.com/d/optout.


--
Iacopo Spalletti

Nephila s.a.s. - Firenze
Telefono: +39 055 5357189
Assistenza Tecnica: +39 055 3985730
http://nephila.it

signature.asc
Reply all
Reply to author
Forward
0 new messages