← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1532243] Re: glance fails silently if a task flow can't be loaded

 

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 <stuart.mclaren@xxxxxx>
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

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to Glance.
https://bugs.launchpad.net/bugs/1532243

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

Status in Glance:
  Fix Released

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

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


References