Unnecessarily use of a list and extra loop call to offload the shelved instances whose shelved time passed the shelved offload time

Bug #1764332 reported by lucky
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Invalid
Low
Unassigned

Bug Description

Unnecessarily use of a list and extra loop call to offload the shelved instances whose shelved time passed the shelved offload time.

To offload the shelved instances whose shelved time passed the shelved offload time, first list is created and then this list of shelved instances is processed in extra loop. Instead of creating a list of offload ready shelved instances and processing them later, same can be done in one loop.

Code should be refactored. Instead of creating a list of offload ready shelved instances and processing them later, same can be done in one loop. Instances can be offloaded the time when their shelved time is checked. (Reference File: nova/compute/manger.py, Function: _poll_shelved_instances, Line No: 5847)

Tags: compute
Revision history for this message
Matt Riedemann (mriedem) wrote :
tags: added: compute
Changed in nova:
status: New → Triaged
importance: Undecided → Low
Revision history for this message
Matt Riedemann (mriedem) wrote :

Well, wait. In looking at this, I assume it's done in two loops because the first loop is time-sensitive in collecting the list of instances that should be offloaded, the 2nd loop then offloads those instances from the first loop. If we merge the loops, we could end up shelving things that we might not before because the offload operation slides the window. So I'm going to mark this as invalid.

Changed in nova:
status: Triaged → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.