<html><body>
<p><font size="2" face="sans-serif">According to this bug <a href="https://bugs.launchpad.net/nova/+bug/1268569">https://bugs.launchpad.net/nova/+bug/1268569</a></font><br>
<br>
<font size="2" face="sans-serif">I am wondering someone can help me in understanding the concurrent access prevention on api layer? </font><br>
<br>
<font size="2" face="sans-serif">if we have more than 1 nova-api server, let's say 2(thread A and thread B) ,so both of them should be able to handle request from user </font><br>
<font size="2" face="sans-serif">let's say we delete same floating ip 2 times at almost same time, </font><br>
<font size="2" face="sans-serif">if thread A and B both pass the test in following logic (that's possible because they run concurrently)</font><br>
<br>
<font size="2" face="sans-serif">api/openstack/compute/contrib/floating_ips.py </font><br>
<font size="2" face="sans-serif">def delete(self, req, id):</font><br>
<font size="2" face="sans-serif">..........</font><br>
<font size="2" face="sans-serif">try:</font><br>
<font size="2" face="sans-serif">            floating_ip = self.network_api.get_floating_ip(context, id)</font><br>
<font size="2" face="sans-serif">        except (exception.NotFound, exception.InvalidID):</font><br>
<font size="2" face="sans-serif">            msg = _("Floating ip not found for id %s") % id</font><br>
<font size="2" face="sans-serif">            raise webob.exc.HTTPNotFound(explanation=msg)</font><br>
<font size="2" face="sans-serif">..........</font><br>
<br>
<font size="2" face="sans-serif">then both of them will call following function </font><br>
<font size="2" face="sans-serif">self.network_api.release_floating_ip(context, address)</font><br>
<br>
<font size="2" face="sans-serif">at last function deallocate_floating_ip in nova/network/float_ips.py will be called by both A and B ,this will not lead to logic error </font><br>
<font size="2" face="sans-serif">because db layer will not return error if it can't find the floating_ip </font><br>
<font size="2" face="sans-serif">but quota will be reserve and commit 2 times, that lead to wrong quota error </font><br>
<br>
<font size="2" face="sans-serif">Could someone help to clarify my understanding or any help on what kind of concurrent access prevention we have ? </font><br>
<font size="2" face="sans-serif">         </font><br>
<br>
<font size="2" face="sans-serif">Best Regards! <br>
<br>
Kevin (Chen) Ji ¼Í ³¿<br>
<br>
Engineer, zVM Development, CSTL<br>
Notes: Chen CH Ji/China/IBM@IBMCN   Internet: jichenjc@cn.ibm.com<br>
Phone: +86-10-82454158<br>
Address: 3/F Ring Building, ZhongGuanCun Software Park, Haidian District, Beijing 100193, PRC </font></body></html>