During compute/terminate_instance networking is de-allocated by a call to
network/api/deallocate_for_instance(), which is implemented as an rpc.cast to
the network manager. This in turn will eventually call
network/manager/deallocate_fixed_ip(), which in turn call the compute API to
trigger a security group refresh, which will get the instance from the database
However because original call to the network manager is a cast there is a chance
that the compute manager will delete the instance record in the DB before the
compute API (in the network manager) tries to retrieve the instance. At this
point the security group refresh fails (leaving rules in place which are a
security risk when the IP is reused), and potentially stopping otheraspects
of the network deallocation from completing.
Changing this from rpc.call to rpc.cast will fix this issue.
Aside from this specific use of a cast there are 4 other casts in the
network API:
add_fixed_ip_to_instance
remove_fixed_ip_from_instance
add_network_to_project
release_floating_ip
and to avoid other timing issues these will also be converted to calls.
Reviewed: https:/ /review. openstack. org/9630 github. com/openstack/ nova/commit/ 34f9d7e974d0e09 c723e0a04ed6eec d1b482e77d
Committed: http://
Submitter: Jenkins
Branch: master
commit 34f9d7e974d0e09 c723e0a04ed6eec d1b482e77d
Author: Phil Day <email address hidden>
Date: Wed Jul 11 09:26:11 2012 +0100
Convert remaining network API casts to calls
Fix for Bug 1021340
During compute/ terminate_ instance networking is de-allocated by a call to api/deallocate_ for_instance( ), which is implemented as an rpc.cast to manager/ deallocate_ fixed_ip( ), which in turn call the compute API to
network/
the network manager. This in turn will eventually call
network/
trigger a security group refresh, which will get the instance from the database
However because original call to the network manager is a cast there is a chance
that the compute manager will delete the instance record in the DB before the
compute API (in the network manager) tries to retrieve the instance. At this
point the security group refresh fails (leaving rules in place which are a
security risk when the IP is reused), and potentially stopping otheraspects
of the network deallocation from completing.
Changing this from rpc.call to rpc.cast will fix this issue.
Aside from this specific use of a cast there are 4 other casts in the fixed_ip_ to_instance fixed_ip_ from_instance network_ to_project floating_ ip
network API:
add_
remove_
add_
release_
and to avoid other timing issues these will also be converted to calls.
Change-Id: I5cdcc628293d3e 7cf165c5ffe4883 f138783f73f