Comment 2 for bug 1482019

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

Reviewed: https://review.openstack.org/182165
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=26a4f430d1ec45f7b9a61b69f009a705d2d3cd52
Submitter: Jenkins
Branch: master

commit 26a4f430d1ec45f7b9a61b69f009a705d2d3cd52
Author: Rui Chen <email address hidden>
Date: Mon May 11 17:45:04 2015 +0800

    Fix resource leaking when consume_from_instance raise exception

    When we boot instance with force host, and the instance
    request some pci devices, all the scheduler filters
    would been ignored, include: PciPassthroughFilter.
    So if the specified host can't apply the pci request,
    PciDeviceRequestFailed exception would been raised
    from HostState.consume_from_instance, at this time
    the part of compute resource had been updated,
    e.g. vcpus, ram, disk and so on, we should make
    the resource of HostState having chance to been reverted
    in order to avoid resource leaking.

    When the exception is raised from self.pci_stats.apply_requests(),
    catch it and don't set the update field of HostState,
    HostState will be synced with db in next scheduling,
    the resource is reverted at that time.

    Change-Id: I0a87088d56337bcd180606013a5473fa2ec6c608
    Related-Bug: #1391816
    Closes-Bug: #1482019