Skip to content

Commit

Permalink
Fix VM-Vrouter ref update race.
Browse files Browse the repository at this point in the history
When there is an add followed by delete, back-to-back, it is possible
VNC layer may not have updated the VM with vrouter info, as that ref
update is a seperate event.

Since VM's are always expected to vrouter info, if the ref is missing,
update that vrouter record in config db by reading from vnc.

Change-Id: I1771bad79ea6f58a768d9481224456fe7089534e
Closes-Bug: #1689905
  • Loading branch information
dineshb-jnpr committed May 12, 2017
1 parent 488c93d commit aeeb311
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/container/kube-manager/kube_manager/vnc/vnc_pod.py
Expand Up @@ -396,6 +396,12 @@ def vnc_pod_delete(self, pod_id):
if not vm:
return

# If this VM's vrouter info is not available in our config db,
# then it is a case of race between delete and ref updates.
# So explicitly update this entry in config db.
if not vm.virtual_router:
vm.update()

self._clear_label_to_pod_cache(vm)

if vm.virtual_router:
Expand Down

0 comments on commit aeeb311

Please sign in to comment.