)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"879c485da5a028b7b18515218ddc8cae1cbac102","unresolved":false,"context_lines":[{"line_number":10,"context_line":"associated with instance and at the same time is removed)"},{"line_number":11,"context_line":"was fixed."},{"line_number":12,"context_line":"To prevent appearing orphan floating IPs additional locker"},{"line_number":13,"context_line":"was added in function deallocate_floating_ip."},{"line_number":14,"context_line":""},{"line_number":15,"context_line":"Closes-Bug: #1392923"},{"line_number":16,"context_line":"Change-Id: I59fbad310fdb5ee67a872d97528221bd8ce5b3c2"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":5,"id":"7ad32947_4ad0d553","line":13,"updated":"2015-04-27 20:35:27.000000000","message":"Marian, please improve this commit message. Saying \"Disasociating orphan floating IP... was fixed\" is not informative, since the commit summary already says that. Similarly, saying \"additional locker was added\" is really vague.\n\nThe commit message should describe the technique you used in the fix and why you chose to fix things this way. After reading the patch contents, I would have hoped to see something in the commit message about an additional SQL join to the fixed_ips table as well as an indication that you are using a technique that introduces additional WHERE clauses and a raises an exception when an UPDATE returns no rows affected.","commit_id":"1839838e8355441b62eb706cb467809357de3e54"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"f70eee0f54595058211eadda88a96632904ccb6c","unresolved":false,"context_lines":[{"line_number":11,"context_line":"floating IP addresses method \u0027deallocate_floating_ip\u0027 was synchronized"},{"line_number":12,"context_line":"with \u0027associate_floating_ip\u0027, \u0027disassociate_floating_ip\u0027 methods."},{"line_number":13,"context_line":"Such synchronization is not enough for multinode environment."},{"line_number":14,"context_line":"That\u0027s why SQL requests for association, disassociation, dealication of"},{"line_number":15,"context_line":"floating IP were updated with additional filters and SQL join statements."},{"line_number":16,"context_line":"SQL join was used to decrease number of SQL requests and therefore to"},{"line_number":17,"context_line":"decrease possibility of races in these operations. Additional WHERE"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":6,"id":"5ad0253b_e2ce9359","line":14,"updated":"2015-04-29 14:26:32.000000000","message":"s/dealication/deallocation/","commit_id":"c9db065ca20a92f5c8d1f6ae8939bcf580b92349"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"4f6ec6eb5c11ddc2641fb4bd1cf51b0a975e702d","unresolved":false,"context_lines":[{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Associating of floating IPs corrected"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Because of races floating IP address can be dealocated and at"},{"line_number":10,"context_line":"the same time it can be associated with instance. To prevent"},{"line_number":11,"context_line":"appearing such orphan floating IP addresses SQL requests for"},{"line_number":12,"context_line":"association and deallocation of floating IP were updated with"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":13,"id":"3afb71cf_4476a307","line":9,"updated":"2015-06-11 17:36:36.000000000","message":"s/Because of races/Due to race conditions,/\n\ns/floating IP address/floating IP addresses/\n\ns/dealocated/deallocated/","commit_id":"12e3e1a7d456650ad0ff7dbf4c4238fe7be80761"},{"author":{"_account_id":14358,"name":"Marian Horban","email":"m.horban@gmail.com","username":"mhorban"},"change_message_id":"fa1ffeea58a68e00573c3befbf0b167183573690","unresolved":false,"context_lines":[{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Associating of floating IPs corrected"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Because of races floating IP address can be dealocated and at"},{"line_number":10,"context_line":"the same time it can be associated with instance. To prevent"},{"line_number":11,"context_line":"appearing such orphan floating IP addresses SQL requests for"},{"line_number":12,"context_line":"association and deallocation of floating IP were updated with"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":13,"id":"fa32b979_d8438a6b","line":9,"in_reply_to":"3afb71cf_4476a307","updated":"2015-06-13 17:11:53.000000000","message":"Done","commit_id":"12e3e1a7d456650ad0ff7dbf4c4238fe7be80761"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"4f6ec6eb5c11ddc2641fb4bd1cf51b0a975e702d","unresolved":false,"context_lines":[{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Because of races floating IP address can be dealocated and at"},{"line_number":10,"context_line":"the same time it can be associated with instance. To prevent"},{"line_number":11,"context_line":"appearing such orphan floating IP addresses SQL requests for"},{"line_number":12,"context_line":"association and deallocation of floating IP were updated with"},{"line_number":13,"context_line":"additional filters: deallocation can be done for floating IP"},{"line_number":14,"context_line":"with empty fixed_ip_id field only, association is allowed for"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":13,"id":"3afb71cf_244a87ad","line":11,"updated":"2015-06-11 17:36:36.000000000","message":"s/prevent appearing such orphan floating IP addresses/prevent such orphan floating IP addresses from appearing,/","commit_id":"12e3e1a7d456650ad0ff7dbf4c4238fe7be80761"},{"author":{"_account_id":14358,"name":"Marian Horban","email":"m.horban@gmail.com","username":"mhorban"},"change_message_id":"fa1ffeea58a68e00573c3befbf0b167183573690","unresolved":false,"context_lines":[{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Because of races floating IP address can be dealocated and at"},{"line_number":10,"context_line":"the same time it can be associated with instance. To prevent"},{"line_number":11,"context_line":"appearing such orphan floating IP addresses SQL requests for"},{"line_number":12,"context_line":"association and deallocation of floating IP were updated with"},{"line_number":13,"context_line":"additional filters: deallocation can be done for floating IP"},{"line_number":14,"context_line":"with empty fixed_ip_id field only, association is allowed for"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":13,"id":"fa32b979_f848ce89","line":11,"in_reply_to":"3afb71cf_244a87ad","updated":"2015-06-13 17:11:53.000000000","message":"Done","commit_id":"12e3e1a7d456650ad0ff7dbf4c4238fe7be80761"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"4f6ec6eb5c11ddc2641fb4bd1cf51b0a975e702d","unresolved":false,"context_lines":[{"line_number":9,"context_line":"Because of races floating IP address can be dealocated and at"},{"line_number":10,"context_line":"the same time it can be associated with instance. To prevent"},{"line_number":11,"context_line":"appearing such orphan floating IP addresses SQL requests for"},{"line_number":12,"context_line":"association and deallocation of floating IP were updated with"},{"line_number":13,"context_line":"additional filters: deallocation can be done for floating IP"},{"line_number":14,"context_line":"with empty fixed_ip_id field only, association is allowed for"},{"line_number":15,"context_line":"floating IP with project_id that equal to current context\u0027s"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":13,"id":"3afb71cf_c4e613b0","line":12,"updated":"2015-06-11 17:36:36.000000000","message":"s/IP were updated/IPs was/","commit_id":"12e3e1a7d456650ad0ff7dbf4c4238fe7be80761"},{"author":{"_account_id":14358,"name":"Marian Horban","email":"m.horban@gmail.com","username":"mhorban"},"change_message_id":"fa1ffeea58a68e00573c3befbf0b167183573690","unresolved":false,"context_lines":[{"line_number":9,"context_line":"Because of races floating IP address can be dealocated and at"},{"line_number":10,"context_line":"the same time it can be associated with instance. To prevent"},{"line_number":11,"context_line":"appearing such orphan floating IP addresses SQL requests for"},{"line_number":12,"context_line":"association and deallocation of floating IP were updated with"},{"line_number":13,"context_line":"additional filters: deallocation can be done for floating IP"},{"line_number":14,"context_line":"with empty fixed_ip_id field only, association is allowed for"},{"line_number":15,"context_line":"floating IP with project_id that equal to current context\u0027s"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":13,"id":"fa32b979_985e6244","line":12,"in_reply_to":"3afb71cf_c4e613b0","updated":"2015-06-13 17:11:53.000000000","message":"Done","commit_id":"12e3e1a7d456650ad0ff7dbf4c4238fe7be80761"}],"nova/db/sqlalchemy/api.py":[{"author":{"_account_id":10618,"name":"Pavel Kholkin","email":"p.v.holkin@mail.ru","username":"pkholkin"},"change_message_id":"0a9be83ddb520fa8677bb8cafa7fdb23203739b1","unresolved":false,"context_lines":[{"line_number":865,"context_line":"                fixed_floating_ip_ref[1][\u0027fixed_ip_id\u0027]):"},{"line_number":866,"context_line":"            return None"},{"line_number":867,"context_line":"        updated_rows \u003d model_query("},{"line_number":868,"context_line":"            context, models.FloatingIp, session\u003dsession).\\"},{"line_number":869,"context_line":"            filter(models.FloatingIp.address \u003d\u003d floating_address).\\"},{"line_number":870,"context_line":"            filter(models.FloatingIp.project_id !\u003d null()).\\"},{"line_number":871,"context_line":"            update({\u0027fixed_ip_id\u0027: fixed_floating_ip_ref[0][\u0027id\u0027],"}],"source_content_type":"text/x-python","patch_set":4,"id":"ba7be1f8_ecb20305","line":868,"updated":"2015-02-24 14:44:16.000000000","message":"I think it would be better to add filter by primary_key:\n\n    filter_by(id\u003dfixed_floating_ip_ref[\u0027id\u0027]).\\","commit_id":"aeb19fa7ea2cc966fa1de5b1640d3e996fe3ec03"},{"author":{"_account_id":14358,"name":"Marian Horban","email":"m.horban@gmail.com","username":"mhorban"},"change_message_id":"6a15e30c8e7cdc7999cfd9ec3143eef0b7812f98","unresolved":false,"context_lines":[{"line_number":865,"context_line":"                fixed_floating_ip_ref[1][\u0027fixed_ip_id\u0027]):"},{"line_number":866,"context_line":"            return None"},{"line_number":867,"context_line":"        updated_rows \u003d model_query("},{"line_number":868,"context_line":"            context, models.FloatingIp, session\u003dsession).\\"},{"line_number":869,"context_line":"            filter(models.FloatingIp.address \u003d\u003d floating_address).\\"},{"line_number":870,"context_line":"            filter(models.FloatingIp.project_id !\u003d null()).\\"},{"line_number":871,"context_line":"            update({\u0027fixed_ip_id\u0027: fixed_floating_ip_ref[0][\u0027id\u0027],"}],"source_content_type":"text/x-python","patch_set":4,"id":"1a6ced46_a0b735d7","line":868,"in_reply_to":"ba7be1f8_ecb20305","updated":"2015-03-25 09:50:12.000000000","message":"Done","commit_id":"aeb19fa7ea2cc966fa1de5b1640d3e996fe3ec03"},{"author":{"_account_id":10618,"name":"Pavel Kholkin","email":"p.v.holkin@mail.ru","username":"pkholkin"},"change_message_id":"0a9be83ddb520fa8677bb8cafa7fdb23203739b1","unresolved":false,"context_lines":[{"line_number":872,"context_line":"                    \u0027host\u0027: host})"},{"line_number":873,"context_line":"        if not updated_rows:"},{"line_number":874,"context_line":"            raise exception.FloatingIpNotFoundForAddress("},{"line_number":875,"context_line":"                address\u003dfloating_address)"},{"line_number":876,"context_line":""},{"line_number":877,"context_line":"        return fixed_floating_ip_ref[0]"},{"line_number":878,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"ba7be1f8_ac4c8b9f","line":875,"updated":"2015-02-24 14:44:16.000000000","message":"Is it ok to raise the same exception if no rows were updated? And could it be really? May be testcase for it?","commit_id":"aeb19fa7ea2cc966fa1de5b1640d3e996fe3ec03"},{"author":{"_account_id":14358,"name":"Marian Horban","email":"m.horban@gmail.com","username":"mhorban"},"change_message_id":"b8b106679c3ddaf401409f0f815f91e634c03b28","unresolved":false,"context_lines":[{"line_number":872,"context_line":"                    \u0027host\u0027: host})"},{"line_number":873,"context_line":"        if not updated_rows:"},{"line_number":874,"context_line":"            raise exception.FloatingIpNotFoundForAddress("},{"line_number":875,"context_line":"                address\u003dfloating_address)"},{"line_number":876,"context_line":""},{"line_number":877,"context_line":"        return fixed_floating_ip_ref[0]"},{"line_number":878,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"ba7be1f8_4e277cca","line":875,"in_reply_to":"ba7be1f8_ac4c8b9f","updated":"2015-02-24 16:34:07.000000000","message":"If row found in SELECT was deallocated by other process/node FloatingIp.project_id can be equal NULL and I believe that FloatingIpNotFoundForAddress should be rises(because it was deallocated).","commit_id":"aeb19fa7ea2cc966fa1de5b1640d3e996fe3ec03"},{"author":{"_account_id":10618,"name":"Pavel Kholkin","email":"p.v.holkin@mail.ru","username":"pkholkin"},"change_message_id":"0a9be83ddb520fa8677bb8cafa7fdb23203739b1","unresolved":false,"context_lines":[{"line_number":918,"context_line":"            raise exception.FloatingIpNotFoundForAddress(address\u003daddress)"},{"line_number":919,"context_line":"        updated_rows \u003d model_query(context,"},{"line_number":920,"context_line":"            models.FloatingIp,"},{"line_number":921,"context_line":"            session\u003dsession).\\"},{"line_number":922,"context_line":"            filter_by(address\u003daddress).\\"},{"line_number":923,"context_line":"            filter(and_(models.FloatingIp.project_id !\u003d null(),"},{"line_number":924,"context_line":"            models.FloatingIp.fixed_ip_id !\u003d null())).\\"}],"source_content_type":"text/x-python","patch_set":4,"id":"ba7be1f8_4ccdcf84","line":921,"updated":"2015-02-24 14:44:16.000000000","message":"the same 1","commit_id":"aeb19fa7ea2cc966fa1de5b1640d3e996fe3ec03"},{"author":{"_account_id":14358,"name":"Marian Horban","email":"m.horban@gmail.com","username":"mhorban"},"change_message_id":"6a15e30c8e7cdc7999cfd9ec3143eef0b7812f98","unresolved":false,"context_lines":[{"line_number":918,"context_line":"            raise exception.FloatingIpNotFoundForAddress(address\u003daddress)"},{"line_number":919,"context_line":"        updated_rows \u003d model_query(context,"},{"line_number":920,"context_line":"            models.FloatingIp,"},{"line_number":921,"context_line":"            session\u003dsession).\\"},{"line_number":922,"context_line":"            filter_by(address\u003daddress).\\"},{"line_number":923,"context_line":"            filter(and_(models.FloatingIp.project_id !\u003d null(),"},{"line_number":924,"context_line":"            models.FloatingIp.fixed_ip_id !\u003d null())).\\"}],"source_content_type":"text/x-python","patch_set":4,"id":"1a6ced46_c0ba71bf","line":921,"in_reply_to":"ba7be1f8_4ccdcf84","updated":"2015-03-25 09:50:12.000000000","message":"Done","commit_id":"aeb19fa7ea2cc966fa1de5b1640d3e996fe3ec03"},{"author":{"_account_id":10618,"name":"Pavel Kholkin","email":"p.v.holkin@mail.ru","username":"pkholkin"},"change_message_id":"0a9be83ddb520fa8677bb8cafa7fdb23203739b1","unresolved":false,"context_lines":[{"line_number":924,"context_line":"            models.FloatingIp.fixed_ip_id !\u003d null())).\\"},{"line_number":925,"context_line":"            update({\u0027fixed_ip_id\u0027: None, \u0027host\u0027: None})"},{"line_number":926,"context_line":"        if not updated_rows:"},{"line_number":927,"context_line":"            raise exception.FloatingIpNotFoundForAddress(address\u003daddress)"},{"line_number":928,"context_line":""},{"line_number":929,"context_line":"    return fixed_floating_ip_ref[0]"},{"line_number":930,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"ba7be1f8_ac33ab12","line":927,"updated":"2015-02-24 14:44:16.000000000","message":"the same 2","commit_id":"aeb19fa7ea2cc966fa1de5b1640d3e996fe3ec03"},{"author":{"_account_id":6849,"name":"Roman Podoliaka","email":"roman.podoliaka@gmail.com","username":"rpodolyaka"},"change_message_id":"6281384edec7c09b30cea59185e34426ce9e4851","unresolved":false,"context_lines":[{"line_number":884,"context_line":"                                   fixed_address, host):"},{"line_number":885,"context_line":"    session \u003d get_session()"},{"line_number":886,"context_line":"    with session.begin():"},{"line_number":887,"context_line":"        # get fixed IP"},{"line_number":888,"context_line":"        fixed_floating_ip_ref \u003d model_query("},{"line_number":889,"context_line":"            context, models.FixedIp, args\u003d(models.FixedIp, models.FloatingIp),"},{"line_number":890,"context_line":"            session\u003dsession).\\"}],"source_content_type":"text/x-python","patch_set":12,"id":"7a016987_5a414ca8","line":887,"updated":"2015-05-29 09:56:23.000000000","message":"I feel like this becomes unnecessary complicated.\n\nMy current understanding of possible transitions between the state of a particular floating IP address is the following: https://goo.gl/RaESzh\n\nSo how about we enforce it not only on nova-network level, but on DB layer level?\n\nE.g. `floating_ip_fixed_ip_associate()` would become something like:\n\n  with session.begin():\n      try:\n          fixed_ip_id \u003d model_query(context, models.FixedIp, models.FixedIp.id, session\u003dsession).scalar()\n       except NotFound:\n           raise appropriate exception\n\n      rows \u003d _floating_ip_get_by_address(context, floating_address, session\u003dsession)\n                   .filter(models.FloatingIp.project_id \u003d\u003d context.project_id)\n                   .filter(or_(models.FloatingIp.fixed_ip_id \u003d\u003d fixed_ip_id, models.FloatingIp.fixed_ip_id.is_(None)))\n                   .update({\u0027fixed_ip_id\u0027: fixed_ip_id, \u0027host\u0027: host})\n\n        if not rows:\n             raise `failed to associate floating IP exception`\n\n\nWith both READ COMMITTED and REPEATABLE READ, UPDATE will lock the updated row, if and only if WHERE clause evaluated as True (i.e. when floating IP is allocated to the project and is not associated with a fixed IP yet).\n\n\nWe could probably change the return value of `floating_ip_fixed_ip_associate()`, so that it simply returns None on success and raises exception on failure.","commit_id":"5e0f5d66a84b5f0ef9be2fccc44e60fdbecb2424"},{"author":{"_account_id":14358,"name":"Marian Horban","email":"m.horban@gmail.com","username":"mhorban"},"change_message_id":"ee7e65e5ec6aab138425b4e7cdf5f80b1fe23585","unresolved":false,"context_lines":[{"line_number":884,"context_line":"                                   fixed_address, host):"},{"line_number":885,"context_line":"    session \u003d get_session()"},{"line_number":886,"context_line":"    with session.begin():"},{"line_number":887,"context_line":"        # get fixed IP"},{"line_number":888,"context_line":"        fixed_floating_ip_ref \u003d model_query("},{"line_number":889,"context_line":"            context, models.FixedIp, args\u003d(models.FixedIp, models.FloatingIp),"},{"line_number":890,"context_line":"            session\u003dsession).\\"}],"source_content_type":"text/x-python","patch_set":12,"id":"3afb71cf_ecb22d05","line":887,"in_reply_to":"7a016987_5a414ca8","updated":"2015-06-11 09:50:13.000000000","message":"Done. But changing return value of `floating_ip_fixed_ip_associate()`, so that it simply returns None on success causes performance degradation. Because if we do it we need to add 2 additional calls to DB in nova/network/floating_ips.py in method _associate_floating_ip\n +                fixed_ip \u003d objects.FixedIP.get_by_address(context, fixed_address)\n +                network \u003d objects.Network.get_by_id(context, \n +                         fixed_ip.network_id)\n -                        interface, fixed[\u0027network\u0027])\n +                        interface, network)","commit_id":"5e0f5d66a84b5f0ef9be2fccc44e60fdbecb2424"},{"author":{"_account_id":6849,"name":"Roman Podoliaka","email":"roman.podoliaka@gmail.com","username":"rpodolyaka"},"change_message_id":"6281384edec7c09b30cea59185e34426ce9e4851","unresolved":false,"context_lines":[{"line_number":918,"context_line":"    return model_query(context, models.FloatingIp).\\"},{"line_number":919,"context_line":"        filter_by(address\u003daddress).\\"},{"line_number":920,"context_line":"        filter(and_(models.FloatingIp.project_id !\u003d null(),"},{"line_number":921,"context_line":"                    models.FloatingIp.fixed_ip_id \u003d\u003d null())).\\"},{"line_number":922,"context_line":"        update({\u0027project_id\u0027: None,"},{"line_number":923,"context_line":"                \u0027host\u0027: None,"},{"line_number":924,"context_line":"                \u0027auto_assigned\u0027: False},"}],"source_content_type":"text/x-python","patch_set":12,"id":"7a016987_70ad479a","line":921,"updated":"2015-05-29 09:56:23.000000000","message":"This is a good example what we want to achieve with `floating_ip_fixed_ip_associate()` and `floating_ip_disassociate()`!\n\nMaybe, we also could raise an exception, if we fail to deallocate an IP.","commit_id":"5e0f5d66a84b5f0ef9be2fccc44e60fdbecb2424"},{"author":{"_account_id":6849,"name":"Roman Podoliaka","email":"roman.podoliaka@gmail.com","username":"rpodolyaka"},"change_message_id":"6281384edec7c09b30cea59185e34426ce9e4851","unresolved":false,"context_lines":[{"line_number":933,"context_line":""},{"line_number":934,"context_line":""},{"line_number":935,"context_line":"@require_context"},{"line_number":936,"context_line":"def floating_ip_disassociate(context, address):"},{"line_number":937,"context_line":"    session \u003d get_session()"},{"line_number":938,"context_line":"    with session.begin():"},{"line_number":939,"context_line":"        # get floating IP"}],"source_content_type":"text/x-python","patch_set":12,"id":"7a016987_f0701742","line":936,"updated":"2015-05-29 09:56:23.000000000","message":"Same as with `floating_ip_fixed_ip_associate()`: let\u0027s use a single UPDATE statement with constraints set in WHERE clause to ensure the updated row is locked properly.","commit_id":"5e0f5d66a84b5f0ef9be2fccc44e60fdbecb2424"},{"author":{"_account_id":5441,"name":"Andrew Laski","email":"andrew@lascii.com","username":"alaski"},"change_message_id":"6f6597be9aa451f663f0ce43917f6eb7c7154338","unresolved":false,"context_lines":[{"line_number":896,"context_line":"                    update({\u0027fixed_ip_id\u0027: fixed_ip_ref[\u0027id\u0027], \u0027host\u0027: host})"},{"line_number":897,"context_line":""},{"line_number":898,"context_line":"        if not rows:"},{"line_number":899,"context_line":"            raise exception.FloatingIpAssociateFailed(address\u003dfloating_address)"},{"line_number":900,"context_line":""},{"line_number":901,"context_line":"        return fixed_ip_ref"},{"line_number":902,"context_line":""}],"source_content_type":"text/x-python","patch_set":13,"id":"3afb71cf_1a0482c4","line":899,"updated":"2015-06-11 18:08:33.000000000","message":"It would be good to see a test for this condition happening.","commit_id":"12e3e1a7d456650ad0ff7dbf4c4238fe7be80761"},{"author":{"_account_id":14358,"name":"Marian Horban","email":"m.horban@gmail.com","username":"mhorban"},"change_message_id":"fa1ffeea58a68e00573c3befbf0b167183573690","unresolved":false,"context_lines":[{"line_number":896,"context_line":"                    update({\u0027fixed_ip_id\u0027: fixed_ip_ref[\u0027id\u0027], \u0027host\u0027: host})"},{"line_number":897,"context_line":""},{"line_number":898,"context_line":"        if not rows:"},{"line_number":899,"context_line":"            raise exception.FloatingIpAssociateFailed(address\u003dfloating_address)"},{"line_number":900,"context_line":""},{"line_number":901,"context_line":"        return fixed_ip_ref"},{"line_number":902,"context_line":""}],"source_content_type":"text/x-python","patch_set":13,"id":"fa32b979_b8ffa633","line":899,"in_reply_to":"3afb71cf_1a0482c4","updated":"2015-06-13 17:11:53.000000000","message":"Done","commit_id":"12e3e1a7d456650ad0ff7dbf4c4238fe7be80761"}],"nova/exception.py":[{"author":{"_account_id":5441,"name":"Andrew Laski","email":"andrew@lascii.com","username":"alaski"},"change_message_id":"6f6597be9aa451f663f0ce43917f6eb7c7154338","unresolved":false,"context_lines":[{"line_number":880,"context_line":""},{"line_number":881,"context_line":""},{"line_number":882,"context_line":"class FloatingIpAssociateFailed(NovaException):"},{"line_number":883,"context_line":"    msg_fmt \u003d _(\"Floating IP %(address)s association is failed.\")"},{"line_number":884,"context_line":""},{"line_number":885,"context_line":""},{"line_number":886,"context_line":"class CannotDisassociateAutoAssignedFloatingIP(NovaException):"}],"source_content_type":"text/x-python","patch_set":13,"id":"3afb71cf_7a6ed697","line":883,"updated":"2015-06-11 18:08:33.000000000","message":"s/is/has/","commit_id":"12e3e1a7d456650ad0ff7dbf4c4238fe7be80761"},{"author":{"_account_id":14358,"name":"Marian Horban","email":"m.horban@gmail.com","username":"mhorban"},"change_message_id":"fa1ffeea58a68e00573c3befbf0b167183573690","unresolved":false,"context_lines":[{"line_number":880,"context_line":""},{"line_number":881,"context_line":""},{"line_number":882,"context_line":"class FloatingIpAssociateFailed(NovaException):"},{"line_number":883,"context_line":"    msg_fmt \u003d _(\"Floating IP %(address)s association is failed.\")"},{"line_number":884,"context_line":""},{"line_number":885,"context_line":""},{"line_number":886,"context_line":"class CannotDisassociateAutoAssignedFloatingIP(NovaException):"}],"source_content_type":"text/x-python","patch_set":13,"id":"fa32b979_b8c7a644","line":883,"in_reply_to":"3afb71cf_7a6ed697","updated":"2015-06-13 17:11:53.000000000","message":"Done","commit_id":"12e3e1a7d456650ad0ff7dbf4c4238fe7be80761"}],"nova/network/floating_ips.py":[{"author":{"_account_id":6849,"name":"Roman Podoliaka","email":"roman.podoliaka@gmail.com","username":"rpodolyaka"},"change_message_id":"bd1c679ccdab9a6a080807b7a8bc724863e79890","unresolved":false,"context_lines":[{"line_number":252,"context_line":""},{"line_number":253,"context_line":"        return floating_ip"},{"line_number":254,"context_line":""},{"line_number":255,"context_line":"    @messaging.expected_exceptions(exception.FloatingIpNotFoundForAddress)"},{"line_number":256,"context_line":"    def deallocate_floating_ip(self, context, address,"},{"line_number":257,"context_line":"                               affect_auto_assigned\u003dFalse):"},{"line_number":258,"context_line":"        \"\"\"Returns a floating ip to the pool.\"\"\""}],"source_content_type":"text/x-python","patch_set":2,"id":"fa81d914_46926e58","line":255,"updated":"2015-01-28 10:32:01.000000000","message":"My current understanding of the race condition described in the bug entry, that it is currently possible to call deallocate_floating_ip() and associate_floating_ip() for the same floating IP entry (allocated for project, but not associated for instance, i.e. project_id is not NULL and fixed_ip_id is NULL in the db).\n\nAs long as we can\u0027t synchronize processes running on different nodes easily (see my comment below), we should probably try to do that at DB level, i.e. ensure deallocation of a floating IP can only be done for a floating ip not associated with an instance (currently, we are missing a condition in WHERE clause here https://github.com/openstack/nova/blob/master/nova/db/sqlalchemy/api.py#L867-L880).","commit_id":"314f336f7bc1ba81490faa595ebe2137c7e1a27c"},{"author":{"_account_id":6849,"name":"Roman Podoliaka","email":"roman.podoliaka@gmail.com","username":"rpodolyaka"},"change_message_id":"bd1c679ccdab9a6a080807b7a8bc724863e79890","unresolved":false,"context_lines":[{"line_number":267,"context_line":"        self._floating_ip_owned_by_project(context, floating_ip)"},{"line_number":268,"context_line":""},{"line_number":269,"context_line":"        # make sure floating ip is not associated"},{"line_number":270,"context_line":"        if floating_ip.fixed_ip_id:"},{"line_number":271,"context_line":"            floating_address \u003d floating_ip.address"},{"line_number":272,"context_line":"            raise exception.FloatingIpAssociated(address\u003dfloating_address)"},{"line_number":273,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"fa81d914_e66d2206","line":270,"updated":"2015-01-28 10:32:01.000000000","message":"this check and deallocation below are not atomic","commit_id":"314f336f7bc1ba81490faa595ebe2137c7e1a27c"},{"author":{"_account_id":6849,"name":"Roman Podoliaka","email":"roman.podoliaka@gmail.com","username":"rpodolyaka"},"change_message_id":"bd1c679ccdab9a6a080807b7a8bc724863e79890","unresolved":false,"context_lines":[{"line_number":271,"context_line":"            floating_address \u003d floating_ip.address"},{"line_number":272,"context_line":"            raise exception.FloatingIpAssociated(address\u003dfloating_address)"},{"line_number":273,"context_line":""},{"line_number":274,"context_line":"        @utils.synchronized(unicode(address))"},{"line_number":275,"context_line":"        def do_deallocate():"},{"line_number":276,"context_line":"            # clean up any associated DNS entries"},{"line_number":277,"context_line":"            self._delete_all_entries_for_ip(context,"}],"source_content_type":"text/x-python","patch_set":2,"id":"fa81d914_2672da7c","line":274,"updated":"2015-01-28 10:32:01.000000000","message":"The problem with this lock (implemented as a file lock) is that it won\u0027t work in a multinode environment, as we only synchronize the processes running on the same node.\n\nSo this only fixes the problem for one node devstack setup.","commit_id":"314f336f7bc1ba81490faa595ebe2137c7e1a27c"}],"nova/tests/unit/db/test_db_api.py":[{"author":{"_account_id":5441,"name":"Andrew Laski","email":"andrew@lascii.com","username":"alaski"},"change_message_id":"6f6597be9aa451f663f0ce43917f6eb7c7154338","unresolved":false,"context_lines":[{"line_number":4762,"context_line":"            self.assertEqual(fixed_ip.id, updated_float_ip.fixed_ip_id)"},{"line_number":4763,"context_line":"            self.assertEqual(\u0027host\u0027, updated_float_ip.host)"},{"line_number":4764,"context_line":""},{"line_number":4765,"context_line":"        # Test that already allocated float_ip returns None"},{"line_number":4766,"context_line":"        fixed_ip \u003d db.floating_ip_fixed_ip_associate(self.ctxt,"},{"line_number":4767,"context_line":"                                                     float_addresses[0],"},{"line_number":4768,"context_line":"                                                     fixed_addresses[0],"}],"source_content_type":"text/x-python","patch_set":13,"id":"3afb71cf_bacd6eb9","line":4765,"updated":"2015-06-11 18:08:33.000000000","message":"This comment is incorrect and confusing now.","commit_id":"12e3e1a7d456650ad0ff7dbf4c4238fe7be80761"},{"author":{"_account_id":14358,"name":"Marian Horban","email":"m.horban@gmail.com","username":"mhorban"},"change_message_id":"fa1ffeea58a68e00573c3befbf0b167183573690","unresolved":false,"context_lines":[{"line_number":4762,"context_line":"            self.assertEqual(fixed_ip.id, updated_float_ip.fixed_ip_id)"},{"line_number":4763,"context_line":"            self.assertEqual(\u0027host\u0027, updated_float_ip.host)"},{"line_number":4764,"context_line":""},{"line_number":4765,"context_line":"        # Test that already allocated float_ip returns None"},{"line_number":4766,"context_line":"        fixed_ip \u003d db.floating_ip_fixed_ip_associate(self.ctxt,"},{"line_number":4767,"context_line":"                                                     float_addresses[0],"},{"line_number":4768,"context_line":"                                                     fixed_addresses[0],"}],"source_content_type":"text/x-python","patch_set":13,"id":"fa32b979_189572e3","line":4765,"in_reply_to":"3afb71cf_bacd6eb9","updated":"2015-06-13 17:11:53.000000000","message":"Done","commit_id":"12e3e1a7d456650ad0ff7dbf4c4238fe7be80761"}]}
