race condition between delete instance(with floating ip associated) and delete floating ip
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack Compute (nova) |
Fix Released
|
Medium
|
wangpan | ||
Grizzly |
Fix Released
|
Medium
|
Russell Bryant |
Bug Description
reproduce steps:
1. create an instance
2. get a floating ip from pool
3. associate the ip to instance created at step 1
4. delete the instance and the ip at a very little interval
then "ERROR: Floating ip is not associated (HTTP 400) (Request-ID: req-7af58a3e-
+------
| Ip | Instance Id | Fixed Ip | Pool |
+------
| 172.24.4.225 | None | None | nova |
+------
and the instance is deleted successfully.
this is a race issue, so you may need to hack in the nova-api codes to reproduce it, like what I did as bellow:
diff --git a/nova/
index bf1246c..d9cb2c2 100644
--- a/nova/
+++ b/nova/
@@ -181,11 +181,15 @@ class FloatingIPContr
raise webob.exc.
address = floating_
# get the associated instance object (if any)
instance = get_instance_
# disassociate if associated
if floating_
+ import time
+ LOG.debug(
+ time.sleep(10)
# release ip from project
then you can delete floating ip at first, and wait for the nova-api debug log of 'sleep 10s', delete the instance when you see this log, this bug will occurs at most of time.
reason may be that:
1. the action of delete ip find the ip is associated to a fixed ip at first(at api level where my debug log is added)
2. and then the fixed ip is released when the instance is deleted
3. so nova-network manager find this issue and raise exception.
I think the expected result is that the floating ip is deleted successfully on this condition.
Changed in nova: | |
milestone: | none → havana-1 |
status: | Fix Committed → Fix Released |
tags: | removed: in-stable-grizzly |
Changed in nova: | |
importance: | Undecided → Medium |
Changed in nova: | |
milestone: | havana-1 → 2013.2 |
Fix proposed to branch: master /review. openstack. org/27470
Review: https:/