Commit Graph

9 Commits (0634dcc6d0f08c18c69a2c360a2c5c0581ec7bb6)

Author SHA1 Message Date
Boden R 60f8048c7c use synchronized lock decorator from neutron-lib
neutron-lib contains the synchronized lockutils decorator as well as
the SYNCHRONIZED_PREFIX global. This patch consumes them from
neutron-lib and removes them from neutron.


Change-Id: I729da348e340509f2d09f8a6436716e2398f1583
6 years ago
Jakub Libosvar 330ebbb1b1 functional-tests: Make addresses for tunneling unique
OVS can hold only one tunnel with same endpoints. Some tests had
hardcoded values for both tunnel endpoints which made them unable to run
in parallel manner.

This patch takes always exclusive address using resource allocator.

Change-Id: If81296d54656551b24917d561f235edb96a6c2df
Closes-bug: #1697533
6 years ago
Jenkins 87cb9d8552 Merge "exclusive_resources: use set remove instead of discard" 6 years ago
Isaku Yamahata 7d42176853 ovsdb: don't erase existing ovsdb managers
The current existing agent erases already set ovsdb managers
entries. In some use cases, cloud admin sets ovsdb managers.
eg, for SDN controllers or monitoring purpose. Neutron agent
shouldn't unconditionally erase the existing ovsdb managers.

This patch implements a new api add_manager (along with
get_manager and remove_manager) to the ovsdb api which will
allow us to configure a manager on a switch without overriding
the existing managers.

Closes-Bug: #1614766
Change-Id: Ibf9bd02fac3070d166546cac478ef984e4e43f28
Co-Authored-By: sridhargaddam <>
Co-Authored-By: Terry Wilson <>
7 years ago
Gary Kotton dbbbe595f4 Use ensure_tree from oslo_utils.fileutils
Make use of the common oslo method to implement ensure_dir.


Change-Id: Ia9e4c581664235476f290a4b651c5a24017ce357
7 years ago
IWAMOTO Toshihiro 66f01fd944 exclusive_resources: use set remove instead of discard
If the release function cannot find a resource in the allocation
pool, it should raise an error.

Change-Id: Ieffd547f5c08fbe56289c99dc0384e7bd8a8f85b
7 years ago
Cedric Brandily 93b7a2014a Improve error when exclusive resource allocation fails
This change uses resource_name instead of class_name
("ResourceAllocator") in error messages when exclusive resource
allocation fails.

Change-Id: I9b544292cd533c3bbc622dbd77faa1e1aac94395
7 years ago
Assaf Muller 36edd14d76 Log fullstack allocation and release of exclusive resources
Change-Id: I0891e6fa0a7f0c65758ac220e6762d084ce0fdf0
7 years ago
Assaf Muller 03999961ac Add fullstack cross-process port/ip address fixtures
We've had a series of bugs with resources that need
to be unique on the system across test runner
processes. Ports are used by neutron-server and the
OVS agent when run in native openflow mode. The function
that generates ports looks up random unused ports and
starts the service. However, it is raceful: By the time the
port is found to be unused and the service is started,
another test runner can pick the same random port.
With close to 65536 ports to choose from, the chance
for collision is low, but given enough test runs, it's
happened a non-trivial amount of times, and given that
a voting job needs a very low false-negative rate, we
need a more robust solution. The same applies to IP
addresses that are used by the OVS agent in tunneling
mode, and for the LB agent in all modes. With IP addresses,
we don't check if the IP address is used, we simply
pick a random address from a large pool, and again
we've seen a non-trivial amount of test failures.

The bugs referenced below had simple, short term solutions
applied but the bugs remain remain. This patch is a correct,
long term solution that doesn't rely on chance.

This patch adds a resource allocator that uses the disk
to persist allocations. Access to the disk is guarded
via a file lock. IP address, networks and ports fixtures
use an allocator internally.

Closes-Bug: #1551288
Closes-Bug: #1561248
Closes-Bug: #1560277
Change-Id: I46c0ca138b806759128462f8d44a5fab96a106d3
7 years ago