OpenStack Compute (Nova)
Go to file
Balazs Gibizer f24e0c1da2 Prevent leaked eventlets to send notifications
In out functional tests we run nova services as eventlets. Also those
services can spawn there own eventlets for RPC or other parallel
processing. The test case executor only sees and tracks the main
eventlet where the code of the test case is running. When that is
finishes the test executor considers the test case to be finished
regardless of the other spawned eventlets. This could lead to leaked
eventlets that are running in parallel with later test cases.

One way that it can cause trouble is via the global variables in
nova.rpc module. Those globals are re-initialized for each test case so
they are not directly leaking information between test cases. However if
a late eventlet calls nova.rpc.get_versioned_notifier() it will get a
totally usable FakeVersionedNotifier object regardless of which test
case this notifier is belongs to or which test case the eventlet belongs
to. This way the late eventlet can send a notification to the currently
running test case and therefore can make it fail.

The current case we saw is the following:

1) The test case
  nova.tests.functional.test_servers.ServersTestV219.test_description_errors
  creates a server but don't wait for it to reach terminal state (ACTIVE
  / ERROR). This test case finishes quickly but leaks running eventlets
  in the background waiting for some RPC call to return.
2) As the test case finished the cleanup code deletes the test case
   specific setup, including the DB.
3) The test executor moves forward and starts running another test case
4) 60 seconds later the leaked eventlet times out waiting for the RPC
   call to return and tries doing things, but fails as the DB is already
   gone. Then it tries to  report this as an error notification. It calls
   nova.rpc.get_versioned_notifier() and gets a fresh notifier that is
   connected to the currently running test case. Then emits the error
   notification there.
5) The currently running test case also waits for an error notification
   to be triggered by the currently running test code. But it gets the
   notification form the late eventlet first. As the content of the
   notification does not match with the expectations the currently
   running test case fails. The late eventlet prints a lot of
   error about the DB being gone making the troubleshooting pretty hard.

This patch proposes a way to fix this by marking each eventlet at spawn
time with the id of the test case that was directly or indirectly
started it.

Then when the NotificationFixture gets a notification it compares the
test case id stored in the calling eventlet with the id of the test case
initialized the NotificationFixture. If the two ids do not match then
the fixture ignores the notification and raises an exception to the
caller eventlet to make it terminate.

Change-Id: I012dcf63306bae624dc4f66aae6c6d96a20d4327
Closes-Bug: #1946339
(cherry picked from commit 61fc81a676)
2021-11-04 08:07:35 +00:00
api-guide/source [doc] port-resource-request-groups not landed in Xena 2021-09-06 13:03:22 +02:00
api-ref/source Merge "Add some missing parameters in docs of os-cells" 2021-09-01 17:06:06 +00:00
devstack Switch to new rolevar for run-tempest role 2021-04-09 16:06:10 +00:00
doc docs: Add nova-volume volume_attachment refresh admin workflow 2021-09-15 10:26:39 +01:00
etc/nova Merge "Add missing [oslo_reports] options" 2021-08-24 13:41:16 +00:00
gate gate: Remove test_evacuate.sh 2021-06-15 17:35:20 +01:00
nova Prevent leaked eventlets to send notifications 2021-11-04 08:07:35 +00:00
playbooks zuul: Replace grenade and nova-grenade-multinode with grenade-multinode 2021-04-29 11:05:58 +01:00
releasenotes Merge "Add the Xena prelude section" 2021-09-16 16:58:24 +00:00
roles [OVN] Adapt the live-migration job scripts to work with OVN 2021-03-15 09:41:03 +00:00
tools db: Final cleanups 2021-08-17 13:50:19 +01:00
.coveragerc Remove nova/openstack/* from .coveragerc 2016-10-12 16:20:49 -04:00
.gitignore tox: Integrate mypy 2020-05-15 15:59:53 +01:00
.gitreview [stable-only]Update .gitreview for stable/xena 2021-09-21 07:15:50 +00:00
.mailmap Add mailmap entry 2014-05-07 12:14:26 -07:00
.pre-commit-config.yaml Switch to hacking 2.x 2020-01-17 11:30:40 +00:00
.stestr.conf Finish stestr migration 2017-11-24 16:51:12 -05:00
.zuul.yaml zuul: Mark live migration jobs as non-voting due to bug #1912310 2021-08-05 13:01:47 +01:00
bindep.txt tests: Allow bindep and test-setup.sh to run on EL distros 2021-06-18 12:34:27 +01:00
CONTRIBUTING.rst [Community goal] Update contributor documentation 2020-03-25 12:01:37 +00:00
HACKING.rst Add two new hacking rules 2021-09-01 12:26:52 +01:00
LICENSE initial commit 2010-05-27 23:05:26 -07:00
lower-constraints.txt db: Final cleanups 2021-08-17 13:50:19 +01:00
MAINTAINERS Fix broken URLs 2017-09-07 15:42:31 +02:00
mypy-files.txt mypy: Add type annotations to 'nova.pci' 2021-04-26 18:06:21 +01:00
README.rst docs: Remove references to XenAPI driver 2020-08-31 15:53:31 +01:00
requirements.txt db: Final cleanups 2021-08-17 13:50:19 +01:00
setup.cfg setup.cfg: Resolve warning 2021-03-09 12:49:50 +00:00
setup.py Updated from global requirements 2017-03-02 11:50:48 +00:00
test-requirements.txt requirements: Add types-paramiko 2021-06-09 15:18:47 +01:00
tox.ini [stable-only]Update TOX_CONSTRAINTS_FILE for stable/xena 2021-09-21 07:16:34 +00:00

OpenStack Nova

image

OpenStack Nova provides a cloud computing fabric controller, supporting a wide variety of compute technologies, including: libvirt (KVM, Xen, LXC and more), Hyper-V, VMware, OpenStack Ironic and PowerVM.

Use the following resources to learn more.

API

To learn how to use Nova's API, consult the documentation available online at:

For more information on OpenStack APIs, SDKs and CLIs in general, refer to:

Operators

To learn how to deploy and configure OpenStack Nova, consult the documentation available online at:

In the unfortunate event that bugs are discovered, they should be reported to the appropriate bug tracker. If you obtained the software from a 3rd party operating system vendor, it is often wise to use their own bug tracker for reporting problems. In all other cases use the master OpenStack bug tracker, available at:

Developers

For information on how to contribute to Nova, please see the contents of the CONTRIBUTING.rst.

Any new code must follow the development guidelines detailed in the HACKING.rst file, and pass all unit tests.

Further developer focused documentation is available at:

Other Information

During each Summit and Project Team Gathering, we agree on what the whole community wants to focus on for the upcoming release. The plans for nova can be found at: