Fix allocate_and_associate DB deadlock
In testing we saw a DB deadlock in allocate_and_associate.
This patch corrects that with a DB retry wrapper.
Change-Id: I20572505e448f9b7ff6314b5167cc4c519c445fb
Story: 2005893
Task: 33751
(cherry picked from commit 0eaab450c1
)
This commit is contained in:
parent
b12f0d9d6c
commit
ac6ff98dfd
|
@ -1081,6 +1081,7 @@ class AmphoraRepository(BaseRepository):
|
|||
id=amphora_id).first()
|
||||
load_balancer.amphorae.append(amphora)
|
||||
|
||||
@oslo_db_api.wrap_db_retry(max_retries=5, retry_on_deadlock=True)
|
||||
def allocate_and_associate(self, session, load_balancer_id):
|
||||
"""Allocate an amphora for a load balancer.
|
||||
|
||||
|
|
|
@ -0,0 +1,4 @@
|
|||
---
|
||||
fixes:
|
||||
- |
|
||||
Fixes a potential DB deadlock in allocate_and_associate found in testing.
|
Loading…
Reference in New Issue