cinder/cinder/wsgi
Eric Harney 90e03570cc Prevent double-attachment race in attachment_reserve
If multiple attachments are requested simultaneously,
a volume can be attached to an instance more than once.

This fixes this problem by detecting that a race has
occurred in _attachment_reserve, and backing out one of
the invalid attachment records.

This means that if the attachment API is called
repeatedly and quickly for the same volume, some requests
may fail, but this is much better than incorrectly
creating multiple attachments.

Closes-Bug: #1833736

Change-Id: Ic2463338b698c5cf805c0ae06d0229f54f64b3fc
(cherry picked from commit 7f3a77b66f)
(cherry picked from commit eadff0df7e)
Conflicts:
	cinder/tests/unit/attachments/test_attachments_api.py
(cherry picked from commit 5f9c93b194)
2019-08-13 14:23:34 -04:00
..
__init__.py Add Cinder API wsgi application 2015-08-25 13:48:03 +03:00
common.py Remove unused logging import and LOG global var 2016-05-20 17:17:38 +08:00
eventlet_server.py Remove unused print_function imports 2017-11-02 11:06:58 -04:00
wsgi.py Prevent double-attachment race in attachment_reserve 2019-08-13 14:23:34 -04:00