[SRU] Infinite recursion in Python 3
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Glance |
Fix Released
|
Undecided
|
Unassigned | ||
Ubuntu Cloud Archive |
Fix Released
|
Critical
|
Unassigned | ||
Rocky |
Fix Released
|
Critical
|
Unassigned | ||
glance (Ubuntu) |
Fix Released
|
Critical
|
Unassigned | ||
Cosmic |
Fix Released
|
Critical
|
Unassigned | ||
Disco |
Fix Released
|
Critical
|
Unassigned |
Bug Description
Hi,
When running unit tests under Python 3.7 when building the Rocky Debian package in Sid, I get a never ending recursion. Please see the Debian bug report:
https:/
Basically, it's this:
| File "/build/
| return dict(self).keys()
| File "/build/
| return dict(self).keys()
| File "/build/
| return dict(self).keys()
| RecursionError: maximum recursion depth exceeded while calling a Python object
== Ubuntu SRU details ==
[Impact]
An infinite recursion error occurs when running Python 3.6 glance from rocky. This issue has also been seen when running python 3.7 unit tests.
The error has also been seen in a Rocky deployment and causes the glance api service to return 500 errors.
[Test Case]
Bionic (cloud-archive): Deploy the glance charm on bionic then upgrade it to rocky by updating the openstack-origin to cloud:bionic-
Cosmic: Note that for cosmic we don't have the ability to test an upgrade from queens to rocky like we can on bionic so we'll just manually test the python3 code.
[Regression Potential]
Fairly low. The patch is a minimal fix and will be fully exercised by the OpenStack charms team.
Changed in glance: | |
status: | New → Confirmed |
Changed in glance (Ubuntu Cosmic): | |
status: | New → Triaged |
importance: | Undecided → Critical |
Changed in glance (Ubuntu Disco): | |
status: | New → Triaged |
importance: | Undecided → Critical |
summary: |
- Unit test infinit recursion in Python 3.7 + [SRU] Infinite recursion in Python 3 |
description: | updated |
description: | updated |
Changed in cloud-archive: | |
status: | Triaged → Fix Committed |
description: | updated |
Changed in glance: | |
milestone: | none → stein-1 |
Around 291 tests fails with python version 3.7.1, everything works with python 3.7.0 and less.
Initial observation is while converting object to dict [1] it again calls keys method which causes the recursion. If I try to change the code to avoid conversion to dict then 20 tests fails. Need to find some workaround, may be we need some expert opinion here.
[1] https:/ /github. com/openstack/ glance/ blob/master/ glance/ domain/ __init_ _.py#L316
Note:
If I remove entire keys function from above line, around 20-40 tests fails for all python versions.