[openstack-dev] [Fuel][Nailgun]Problems with auto-reloading

Vitaly Kramskikh vkramskikh at mirantis.com
Tue Dec 2 13:46:28 UTC 2014


I don't even remember if/when autoreloading worked correctly. +1 for
disabling this feature.

2014-12-02 16:23 GMT+03:00 Roman Prykhodchenko <rprikhodchenko at mirantis.com>
:

> Hi folks,
>
> today we encountered a problem caused by auto-reload feature and our
> code-organisation.
> The problem is that web.py tries reloading modules at some point and while
> it does that it expects that modules could be reloaded in any order without
> raising any errors.
>
> Unfortunately for Nailgun that condition is not satisfied in at least one
> place. That place is SQLAlchemy models which are placed in different
> modules. If web.py tries to reload any model’s module, say
> notifications.py, before reloading base module, Notifications will try
> registering itself in the old Base’s MetaData which already contain info
> about the appropriate table and that causes errors like "Table
> 'notifications' is already defined for this MetaData instance. Specify
> 'extend_existing=True' to redefine options and columns on an existing Table
> object.” That problem happens on every request that touches database.
>
> There are several possible solutions for this problem:
>
> - Disable autoreload even in Debug mode, because tests always run in that
> mode and that’s the cause these failures occure
>   - Someone might need that so a command line option or config parameter
> for autoreload
> - Re-organise code to guarantee correct reloading order
> - Enable extention of existing tables in metadata, but I’m not sure what
> will be other consequences for that.
>
>
> - romcheg
>
> _______________________________________________
> OpenStack-dev mailing list
> OpenStack-dev at lists.openstack.org
> http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev
>
>


-- 
Vitaly Kramskikh,
Software Engineer,
Mirantis, Inc.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstack.org/pipermail/openstack-dev/attachments/20141202/3889315a/attachment.html>


More information about the OpenStack-dev mailing list