neutron/neutron/agent/dhcp
Kevin Benton 37de2f6c4c Lock in DHCP agent based on network_id
All cache operations and dnsmasq process operations
are scoped to a network ID so we can always safely
perform concurrent actions on different network IDs.
This patch adjusts the DHCP agent to lock based on
network ID rather than having a global lock for every
operation.

sync_state calls are still protected with a reader/writer
lock to ensure that when sync_state needs to run, all
other operations are blocked.

Related-Bug: #1548190
Change-Id: I56010dc801d82be56f12e834c5164316872c2f8b
(cherry picked from commit d1930cefd2)

Squashed this this commit since tests fail otherwise:

Always acquire network.id lock in dhcp port update

Looking at the cache before aqcuiring a lock may cause the
agent to mistakenly think the network doesn't exist when it
is actually being wired in parallel.

Always acquiring the network-based semaphore will ensure that
the network isn't currently being setup in another coroutine.

Closes-Bug: #1659919
Change-Id: I99ae71e3c5b1cd91dca3f6c80b04d2ecb79de64f
(cherry picked from commit 38de22bf2d)
2017-04-19 16:00:54 -04:00
..
__init__.py DHCP agent restructuring 2015-01-17 01:03:09 -08:00
agent.py Lock in DHCP agent based on network_id 2017-04-19 16:00:54 -04:00