ComputeCapabilitiesFilter doesn't provide enough information on failure

Bug #1370948 reported by Matthew Gilliard
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Wishlist
Markus Zoeller (markus_z)

Bug Description

ComputeCapabilitiesFilter code is convoluted. There are at least 4 different ways it can fail, and 3 of them don't provide any output at all. The one which does logs at debug (should be info), and does not actually provide enough info to diagnose the problem.

The code around here https://github.com/openstack/nova/blob/master/nova/scheduler/filters/compute_capabilities_filter.py#L33 and below could do with a nice bit of TLC. For example:

- the for loop on line #49 can only ever be iterating on range(0,1) which is "once", ie no need for a loop.
- the redefinition of "cap" makes it difficult to reason about what data is being worked on.
- the above-mentioned lack of logging.

I recommend checking the strength of the unit tests also, to give confidence that a refactoring doesn't introduce any regressions.

summary: - ComputeCapabilitiesFilter doesn't provide enough debug output on failure
+ ComputeCapabilitiesFilter doesn't provide enough information on failure
description: updated
description: updated
description: updated
Revision history for this message
Sean Dague (sdague) wrote :

putting into wishlist state because it's not at straight forward 'fix this bug' kind of thing, but more about refactoring. Happy to land patches to clean this up, though in general refactoring like this is valid without bugs as long as we aren't in feature freeze.

Changed in nova:
status: New → Confirmed
importance: Undecided → Wishlist
description: updated
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/148610

Changed in nova:
assignee: nobody → Markus Zoeller (mzoeller)
status: Confirmed → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

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

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

Reviewed: https://review.openstack.org/148610
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=670647e7184f2bfd84073eb35796777124eca854
Submitter: Jenkins
Branch: master

commit 670647e7184f2bfd84073eb35796777124eca854
Author: Markus Zoeller <email address hidden>
Date: Tue Jan 20 14:23:43 2015 +0100

    Refactor ComputeCapabilitiesFilter as bugfix preparation

    The ComputeCapabilitiesFilter filters hosts for multiple reasons.
    The reasons for filtering are not logged. The code was convoluted.
    This change prepares the bugfix by:
    * adding unit tests to cover all possible code paths
    * extract a part of the convoluted method

    Partial-bug: #1370948

    Change-Id: I4748b5bda21176df0cb7e0b166679f844e368717

Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

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

commit bcb3a9bda0792803677024450080703e70824574
Author: Markus Zoeller <email address hidden>
Date: Wed Jan 28 10:30:42 2015 +0100

    Adds logging to ComputeCapabilitiesFilter failures

    The ComputeCapabilitiesFilter filters hosts for multiple reasons.
    The reasons for filtering were not logged.
    This change adds logging for the filter reasons.

    Closes-bug: #1370948

    Change-Id: I50efdfde3acfea1a717e7eff907a320a5e637c64

Changed in nova:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in nova:
milestone: none → kilo-2
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in nova:
milestone: kilo-2 → 2015.1.0
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.