← Back to team overview

yahoo-eng-team team mailing list archive

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

 

Public bug reported:

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

** Affects: glance
     Importance: Undecided
         Status: New

-- 
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:
  New

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


Follow ups