← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1729445] Re: Potential IndexError if using the CachingScheduler and not getting alternates

 

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 <mriedem.os@xxxxxxxxx>
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

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to OpenStack Compute (nova).
https://bugs.launchpad.net/bugs/1729445

Title:
  Potential IndexError if using the CachingScheduler and not getting
  alternates

Status in OpenStack Compute (nova):
  Fix Released

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.

To manage notifications about this bug go to:
https://bugs.launchpad.net/nova/+bug/1729445/+subscriptions


References