yahoo-eng-team team mailing list archive
-
yahoo-eng-team team
-
Mailing list archive
-
Message #84343
[Bug 1743120] Re: placement inadvertently imports many python modules it does not need
** Changed in: nova
Status: Fix Committed => Fix Released
--
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to OpenStack Compute (nova).
https://bugs.launchpad.net/bugs/1743120
Title:
placement inadvertently imports many python modules it does not need
Status in OpenStack Compute (nova):
Fix Released
Bug description:
The placement WSGI app has its own WSGI framework and is the only script/binary that placement uses. From the outset, it has been intended that a deployment could run multiple placement servers, distributed across multiple hosts/pods/whatever, with some form of load balancing proxy in front.
In that model, it would be ideal for the app to require as few python
module as possible, and have as small a footprint, at least starting
up, as possible.
Currently, that's not the case, for two reasons:
* Placement makes use of the FaultWrapper WSGI middleware to catch
unexpected exceptions and turn them into status 500 HTTP responses.
FaultWrapper imports nova.utils and nova.utils imports a lot of stuff.
* Placement is within the nova/api/openstack package hierarchy and
nova/api/openstack/__init__.py contains active code and imports which
placement does not need.
These problems can be addressed:
* FaultWrapper is overkill for the placement WSGI app. FaultWrapper is
capable of decoding a variety of exceptions into a variety of status
responses. This is not required by placement. The only exceptions that
can make it to FaultWrapper in placement are those that would result
in a 500. A simpler middleware can handle this.
* nova/api/openstack/__init__.py should be emptied, the contents moved
to a file which is explicitly imported by those modules that actually
want it. Presumably, this could also provide an avenue for lightening
the metadata API.
Note that this is not the only case of inadvertent imports, but is one
of the main vectors. Others will be identified and additional bugs
created.
To manage notifications about this bug go to:
https://bugs.launchpad.net/nova/+bug/1743120/+subscriptions
References