Skip to content

Commit 025bfdd

Browse files
Zuulopenstack-gerrit
authored andcommitted
Merge "Fix race condition in members batch update API call"
2 parents 33fed53 + 8a47577 commit 025bfdd

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

octavia/api/v2/controllers/member.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -336,7 +336,6 @@ def put(self, additive_only=False, members_=None):
336336

337337
with context.session.begin():
338338
db_pool = self._get_db_pool(context.session, self.pool_id)
339-
old_members = db_pool.members
340339

341340
project_id, provider = self._get_lb_project_id_provider(
342341
context.session, db_pool.load_balancer_id)
@@ -354,6 +353,11 @@ def put(self, additive_only=False, members_=None):
354353
with context.session.begin():
355354
self._test_lb_and_listener_and_pool_statuses(context.session)
356355

356+
# Reload the pool, the members may have been updated between the
357+
# first query in this function and the lock of the loadbalancer
358+
db_pool = self._get_db_pool(context.session, self.pool_id)
359+
old_members = db_pool.members
360+
357361
old_member_uniques = {
358362
(m.ip_address, m.protocol_port): m.id for m in old_members}
359363
new_member_uniques = [
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
fixes:
3+
- |
4+
Fixed a race condition in the members batch update API call, the data
5+
passed to the Octavia worker service may have been incorrect when quickly
6+
sending successive API calls. Then the load balancer was stuck in
7+
PENDING_UPDATE provisioning_status.

0 commit comments

Comments
 (0)