race condition in network noop driver

Bug #2036383 reported by Gregory Thiemonge
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
octavia
New
Undecided
Unassigned

Bug Description

There's a race condition in the network noop driver that prevents the multivip tests (https://review.opendev.org/c/openstack/octavia-tempest-plugin/+/664462) from being run concurrently.

There are some tricks in the noop driver for associating subnets with networks.
Basically, a call to get_subnet(subnet_id) returns a subnet that belongs to the network (network_id) that was used in the previous call to get_network(network_id) :

def get_network(self, network_id)
    sets 'current_network' to network_id

https://opendev.org/openstack/octavia/src/commit/d7bba6c5af3c0f6d99ea8063b54ec3e895a5eea4/octavia/network/drivers/noop_driver/driver.py#L217

def get_subnet(self, subnet_id)
    associates subnet_id to the 'current_network'

https://opendev.org/openstack/octavia/src/commit/d7bba6c5af3c0f6d99ea8063b54ec3e895a5eea4/octavia/network/drivers/noop_driver/driver.py#L229

it works fine when using tempest with one thread.
But the behavior is undefined when using multiple threads, two threads may call get_network at the same time, then any calls to get_subnet return a subnet that may be associated to the network of another test.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.