glance fails silently if a task flow can't be loaded

Bug #1532243 reported by Stuart McLaren
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Glance
Fix Released
Undecided
Stuart McLaren

Bug Description

In this try block:

    try:
        # NOTE(flaper87): ImportToLocal and DeleteFromLocal shouldn't be here.
        # Ideally, we should have the different import flows doing this for us
        # and this function should clean up duplicated tasks. For example, say
        # 2 flows need to have a local copy of the image - ImportToLocal - in
        # order to be able to complete the task - i.e Introspect-. In that
        # case, the introspect.get_flow call should add both, ImportToLocal and
        # DeleteFromLocal, to the flow and this function will reduce the
        # duplicated calls to those tasks by creating a linear flow that
        # ensures those are called before the other tasks. For now, I'm
        # keeping them here, though.
        limbo = lf.Flow(task_type).add(_ImportToFS(task_id,
                                                   task_type,
                                                   task_repo,
                                                   uri))

        for subflow in _get_import_flows(**kwargs):
            limbo.add(subflow)

        # NOTE(flaper87): We have hard-coded 2 tasks,
        # if there aren't more than 2, it means that
        # no subtask has been registered.
        if len(limbo) > 1:
            flow.add(limbo)

            # NOTE(flaper87): Until this implementation gets smarter,
            # make sure ImportToStore is called *after* the imported
            # flow stages. If not, the image will be set to saving state
            # invalidating tasks like Introspection or Convert.
            flow.add(import_to_store)

            # NOTE(flaper87): Since this is an "optional" task but required
            # when `limbo` is executed, we're adding it in its own subflow
            # to isolate it from the rest of the flow.
            delete_flow = lf.Flow(task_type).add(_DeleteFromFS(task_id,
                                                               task_type))
            flow.add(delete_flow)
        else:
            flow.add(import_to_store)
    except exception.BadTaskConfiguration:
        # NOTE(flaper87): If something goes wrong with the load of
        # import tasks, make sure we go on.
        flow.add(import_to_store)

We silently suppress a bad task configuration exception (with no information logged).

The exception contains useful information which should at least be logged:

 BadTaskConfiguration: 8ada245a-28f6-4675-ab1d-3fa3300e8393 of import not configured properly. Missing work dir: None

Changed in glance:
assignee: nobody → Stuart McLaren (stuart-mclaren)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to glance (master)

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

Changed in glance:
status: New → In Progress
Revision history for this message
Stuart McLaren (stuart-mclaren) wrote :
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on glance (master)

Change abandoned by Stuart McLaren (<email address hidden>) on branch: master
Review: https://review.openstack.org/265329

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

Reviewed: https://review.openstack.org/265329
Committed: https://git.openstack.org/cgit/openstack/glance/commit/?id=38158e554560621fa85d36aa2c288c04a94fb527
Submitter: Jenkins
Branch: master

commit 38158e554560621fa85d36aa2c288c04a94fb527
Author: Stuart McLaren <email address hidden>
Date: Fri Jan 8 16:01:18 2016 +0000

    Log when task is not configured properly

    Currently we fail silently when a task is not configured properly.
    Silent failures make things particularly hard to understand when behaviour
    does not match expectations.

    Change-Id: Ib4d8f2bdf3299caaf91bd5a99c6a014f87143e4a
    Closes-bug: 1532243

Changed in glance:
status: In Progress → Fix Released
Revision history for this message
Thierry Carrez (ttx) wrote : Fix included in openstack/glance 13.0.0.0b1

This issue was fixed in the openstack/glance 13.0.0.0b1 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.