← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1324277] [NEW] Use of finally/return considered harmful

 

Public bug reported:

Doing a return from a finally block will end up silently dropping
exceptions.

This can cause unexpected behavior at runtime where unhandled exceptions
are silently dropped when not intended.

This has caused some tests that would should fail because of API
changes, to end up passing.

Examples are test_init_instance_stuck_in_deleting and
test_init_instance_deletes_error_deleting_instance in
nova/tests/compute/test_compute_mgr.py. The _delete_instance method that
is being mocked out has changed, but the finally/return in
nova/compute/manager.py:_init_instance has ended up ignoring the test
failures causing the tests to continue passing.

** Affects: nova
     Importance: Undecided
         Status: New

-- 
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/1324277

Title:
  Use of finally/return considered harmful

Status in OpenStack Compute (Nova):
  New

Bug description:
  Doing a return from a finally block will end up silently dropping
  exceptions.

  This can cause unexpected behavior at runtime where unhandled
  exceptions are silently dropped when not intended.

  This has caused some tests that would should fail because of API
  changes, to end up passing.

  Examples are test_init_instance_stuck_in_deleting and
  test_init_instance_deletes_error_deleting_instance in
  nova/tests/compute/test_compute_mgr.py. The _delete_instance method
  that is being mocked out has changed, but the finally/return in
  nova/compute/manager.py:_init_instance has ended up ignoring the test
  failures causing the tests to continue passing.

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


Follow ups

References