← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1721843] Re: Unversioned notifications not being sent.

 

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

commit 0ffe03a2650a698de1b83289098ed535734b2360
Author: Balazs Gibizer <balazs.gibizer@xxxxxxxxxxxx>
Date:   Mon Oct 9 16:29:09 2017 +0200

    Fix sending legacy instance.update notification
    
    The if_notifications_enabled decorator skips the execution of the
    decorated function if the versioned notifications are not configured
    to be emitted. The send_instance_update_notification() call was wrongly
    decorated with this decorator as it not only sends versioned
    notification but also send the legacy compute.instance.update
    notification as well. This caused that the legacy instance.update
    notification was not emitted when the notification_format config option
    was set to unversioned.
    
    As the _send_versioned_instance_update() call already has the decorator
    the solution is simply to remove the decorator from the
    send_instance_update_notification() call.
    
    Closes-Bug: #1721843
    Change-Id: I9904adeb3de60cff4e29f1ab3c95399bbe9ff2e7


** Changed in: nova
       Status: In Progress => Fix Released

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to OpenStack Compute (nova).
https://bugs.launchpad.net/bugs/1721843

Title:
  Unversioned notifications not being sent.

Status in OpenStack Compute (nova):
  Fix Released
Status in OpenStack Compute (nova) pike series:
  In Progress

Bug description:
  Description
  ===========
  After a vm moves from state 'building' to 'error' an unversioned notification is no longer sent if CONF.notifications.notification_format is set to 'unversioned'.

  Steps to reproduce
  ==================
  In nova.conf set
  [notifications]
  notification_format = unversioned

  Setup environment so VM deploy fails.
  To reproduce easily in my environment I raised a generic Exception just after the call to spawn in orchestrator's start_deploy_simple()
  Attempt to deploy VM.
  Wait for deploy to fail.

  Expected result
  ===============
  When the vm_state changes to 'error' an unversioned notification should be sent.

  Actual result
  =============
  The unversioned notification is not sent.

  Environment
  ===========
  (pike)nova-compute/now 10:16.0.0-201710030907

  
  Additional Info:
  ================
  Problem seems to stem from this change: https://github.com/openstack/nova/commit/29cb8f1c459e6d23dd9303fb570cee773d9c4d02 at:
          if (NOTIFIER.is_enabled() and
                  CONF.notifications.notification_format in ('both',
                                                             'versioned')):
  Because 'unversioned' is not in the list, the @rpc.if_notifications_enabled decorator causes send_instance_update_notification() as well as _send_versioned_instance_update() to effectively be skipped. The name of the decorator and the comment describing it's functionality make it hard to determine is precise intended purpose. The decorator name implies it's checking if notifications are enabled at all. The comment in the decorator states it's specificly checking if versioned notifications are enabled and is in fact what it appears to be doing. Since the decorator was applied to send_instance_update_notification it's effectively blocking unversioned notifications if versioned notifications are not enabled.

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


References