Potential IndexError if using the CachingScheduler and not getting alternates

Bug #1729445 reported by Matt Riedemann
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Medium
Ed Leafe

Bug Description

If we're using the CachingScheduler and we're not getting alternates, maybe because conductor is old, we'll get an IndexError because we're not returning a list of list of selected hosts, we're just returning a list of selected hosts here:

https://github.com/openstack/nova/blob/f974e3c3566f379211d7fdc790d07b5680925584/nova/scheduler/filter_scheduler.py#L342

And the IndexError would happen here:

https://github.com/openstack/nova/blob/f974e3c3566f379211d7fdc790d07b5680925584/nova/scheduler/filter_scheduler.py#L120

We obviously don't have a test covering this scenario.

Tags: scheduler
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (master)

Fix proposed to branch: master
Review: https://review.openstack.org/517134

Changed in nova:
assignee: nobody → Matt Riedemann (mriedem)
status: Triaged → In Progress
Changed in nova:
assignee: Matt Riedemann (mriedem) → Ed Leafe (ed-leafe)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)

Reviewed: https://review.openstack.org/517134
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=a9d92553b36e96daf6c8e6fca609f608e84ba336
Submitter: Zuul
Branch: master

commit a9d92553b36e96daf6c8e6fca609f608e84ba336
Author: Matt Riedemann <email address hidden>
Date: Wed Nov 1 19:48:31 2017 -0400

    Fix return type in FilterScheduler._legacy_find_hosts

    The FilterScheduler._schedule method should be returning
    a list of list of selected hosts. When include_alternatives
    is False in _legacy_find_hosts, it was only returning back
    a list of hosts, which would result in an IndexError when
    select_destinations() tries to take the first entry from each
    item in the list.

    Change-Id: Ia6c87900605d3604beb74b942b0e30575b814112
    Closes-Bug: #1729445

Changed in nova:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/nova 17.0.0.0b2

This issue was fixed in the openstack/nova 17.0.0.0b2 development milestone.

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.