placement inadvertently imports many python modules it does not need
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack Compute (nova) |
Fix Released
|
Low
|
Chris Dent |
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/
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/
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/
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.
Changed in nova: | |
status: | Fix Committed → Fix Released |
Fix proposed to branch: master /review. openstack. org/533752
Review: https:/