← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1840978] Re: nova-manage commands with unexpected errors returning 1 conflict with expected cases of 1 for flow control

 

Reviewed:  https://review.opendev.org/677832
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=df2845308dd32e1abd0b75a70f6997b1e4698745
Submitter: Zuul
Branch:    master

commit df2845308dd32e1abd0b75a70f6997b1e4698745
Author: Matt Riedemann <mriedem.os@xxxxxxxxx>
Date:   Wed Aug 21 17:03:11 2019 -0400

    Change nova-manage unexpected error return code to 255
    
    If any nova-manage command fails in an unexpected way and
    it bubbles back up to main() the return code will be 1.
    There are some commands like archive_deleted_rows,
    map_instances and heal_allocations which return 1 for flow
    control with automation systems. As a result, those tools
    could be calling the command repeatedly getting rc=1 thinking
    there is more work to do when really something is failing.
    
    This change makes the unexpected error code 255, updates the
    relevant nova-manage command docs that already mention return
    codes in some kind of list/table format, and adds an upgrade
    release note just to cover our bases in case someone was for
    some weird reason relying on 1 specifically for failures rather
    than anything greater than 0.
    
    Change-Id: I2937c9ef00f1d1699427f9904cb86fe2f03d9205
    Closes-Bug: #1840978


** 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/1840978

Title:
  nova-manage commands with unexpected errors returning 1 conflict with
  expected cases of 1 for flow control

Status in OpenStack Compute (nova):
  Fix Released

Bug description:
  The archive_deleted_rows command returns 1 meaning some records were
  archived and the code documents that if automating and not using
  --until-complete, you should keep going while you get rc=1 until you
  get rc=0:

  https://github.com/openstack/nova/blob/0bf81cfe73340ba5cfd9cf44a38905014ba780f0/nova/cmd/manage.py#L505

  The problem is if some unexpected error happens, let's say there is a
  TypeError in the code or something, the command will also return 1:

  https://github.com/openstack/nova/blob/0bf81cfe73340ba5cfd9cf44a38905014ba780f0/nova/cmd/manage.py#L2625

  That unexpected error should probably be a 255 which generally means a
  command failed in some unexpected way. There might be other nova-
  manage commands that return 1 for flow control as well.

  Note that changing the "unexpected error" code from 1 to 255 is an
  upgrade impacting change worth a release note.

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


References