Listing placement usages causes a circular reference error

Bug #1817633 reported by Chris Dent on 2019-02-25
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
High
Chris Dent

Bug Description

With the removal of oslo versioned objects from from the Usage and UsageList classes, serializing usages can result in a ValueError: Circular reference detected because there is a decimal.Decimal in the data to be returned.

This is a result of a func.sum used in the query to get lists of aggregates.

Note that the creation of a Decimal does not happen with sqlite, so the problem is not revealed by the functional gabbi tests. It happened to show up in the pending gabbi-based integration tests https://review.openstack.org/#/c/601614/ . See: http://logs.openstack.org/08/607508/14/check/placement-gabbi-tempest/f7c3eca/controller/logs/screen-placement-api.txt.gz#_Feb_25_22_37_31_423135 for an example.

This can be fixed by casting the 'used' value to an int when creating a Usage.

Chris Dent (cdent) wrote :
Changed in nova:
status: Triaged → Fix Committed

This issue was fixed in the openstack/placement 1.0.0.0rc1 release candidate.

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers