nova/releasenotes/notes/bug-1892870-eb894956bf04713d.yaml
Alexandre Arents 39831c5599 Add a lock to prevent race during detach/attach of interface
Only allow one detach/attach at a time with the same pattern instance-port_id
in order to avoid race condition when multiple detach/attach are run
concurrently.

When multiple detach run concurrently on a specific instance-port_id,
manager consider many of them as valid because info_cache still contains
the port and info_cache is refreshed only once the first request complete.

So during this gap of time, while the first request accomplishes the task,
all subsequent requests are destined to fail and log a warning [1] in
different location of code, depending on the outcome of the first request.
The Issue is that all those caught requests finally run a
deallocate_port_for_instance which will unbind the port.

This may cause a race condition, because a successful attach can pass between
those unbind, and be silently unbound, resulting in an infrastructure/DB
inconsistency.

[1] 'Detaching interface %(mac)s failed because the device is no longer found
     on the guest.'

Closes-Bug: #1892870
Change-Id: Iea5969d0bd16dc9a6f1ba950224b0115e466ce66
2020-08-28 14:55:42 +00:00

9 lines
282 B
YAML

---
fixes:
- |
Resolve a race condition that may occur during concurrent
``interface detach/attach``, resulting in an interface accidentally unbind
after attached. See `bug 1892870`_ for more details.
.. _bug 1892870: https://bugs.launchpad.net/nova/+bug/1892870