)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"81681d431cd3f2cfe2ae2564f4dc95deb164d804","unresolved":false,"context_lines":[{"line_number":25,"context_line":""},{"line_number":26,"context_line":"There were no existing unit tests for released_fixed_ip so a whole set"},{"line_number":27,"context_line":"of new tests is added to cover the various conditions in the method."},{"line_number":28,"context_line":""},{"line_number":29,"context_line":"Closes-Bug: #1249065"},{"line_number":30,"context_line":""},{"line_number":31,"context_line":"Change-Id: I84fa2f0926f719bff33ac43b39e161a4eb412f44"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":2,"id":"fa32b979_71c5105a","line":28,"updated":"2015-06-24 12:51:17.000000000","message":"Needs the co-authored-by line for Dan.","commit_id":"9f6cec2e3127fdd70b5d297e5bba0f8660543f41"}],"nova/cmd/dhcpbridge.py":[{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"ade8d96b0df32a686afa9754f8d842e64d19e53a","unresolved":false,"context_lines":[{"line_number":64,"context_line":"def del_lease(mac, ip_address):"},{"line_number":65,"context_line":"    \"\"\"Called when a lease expires.\"\"\""},{"line_number":66,"context_line":"    api \u003d network_rpcapi.NetworkAPI()"},{"line_number":67,"context_line":"    api.release_fixed_ip(context.get_admin_context(), ip_address,"},{"line_number":68,"context_line":"                         CONF.host, mac)"},{"line_number":69,"context_line":""},{"line_number":70,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"fa32b979_688ba5c3","line":67,"updated":"2015-06-25 14:28:02.000000000","message":"would it be worthwhile to log the ip/mac pair here?","commit_id":"8c7690221294d6d7f2db84491fec8d81ef358cac"}],"nova/network/manager.py":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"81681d431cd3f2cfe2ae2564f4dc95deb164d804","unresolved":false,"context_lines":[{"line_number":1125,"context_line":"            # with the fixed IP because if it\u0027s not, we hit this race and"},{"line_number":1126,"context_line":"            # should ignore the request so we don\u0027t disassociate the fixed IP"},{"line_number":1127,"context_line":"            # from the wrong instance."},{"line_number":1128,"context_line":"            if mac:"},{"line_number":1129,"context_line":"                vif \u003d objects.VirtualInterface.get_by_address(context, mac)"},{"line_number":1130,"context_line":"                if vif.instance_uuid !\u003d fixed_ip.instance_uuid:"},{"line_number":1131,"context_line":"                    LOG.info(_LI(\"Ignoring request to release fixed IP \""}],"source_content_type":"text/x-python","patch_set":2,"id":"fa32b979_9199b47b","line":1128,"updated":"2015-06-24 12:51:17.000000000","message":"Add a unit test for the case that mac is None.","commit_id":"9f6cec2e3127fdd70b5d297e5bba0f8660543f41"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"81681d431cd3f2cfe2ae2564f4dc95deb164d804","unresolved":false,"context_lines":[{"line_number":1126,"context_line":"            # should ignore the request so we don\u0027t disassociate the fixed IP"},{"line_number":1127,"context_line":"            # from the wrong instance."},{"line_number":1128,"context_line":"            if mac:"},{"line_number":1129,"context_line":"                vif \u003d objects.VirtualInterface.get_by_address(context, mac)"},{"line_number":1130,"context_line":"                if vif.instance_uuid !\u003d fixed_ip.instance_uuid:"},{"line_number":1131,"context_line":"                    LOG.info(_LI(\"Ignoring request to release fixed IP \""},{"line_number":1132,"context_line":"                                 \"%(address)s with MAC %(mac)s since it is \""}],"source_content_type":"text/x-python","patch_set":2,"id":"fa32b979_11ada49a","line":1129,"updated":"2015-06-24 12:51:17.000000000","message":"Should probably check that the vif is not None before using it.","commit_id":"9f6cec2e3127fdd70b5d297e5bba0f8660543f41"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"ade8d96b0df32a686afa9754f8d842e64d19e53a","unresolved":false,"context_lines":[{"line_number":1108,"context_line":"        fixed_ip \u003d objects.FixedIP.get_by_address(context, address)"},{"line_number":1109,"context_line":""},{"line_number":1110,"context_line":"        if fixed_ip.instance_uuid is None:"},{"line_number":1111,"context_line":"            LOG.warning(_LW(\u0027IP %s released that is not associated\u0027), address,"},{"line_number":1112,"context_line":"                        context\u003dcontext)"},{"line_number":1113,"context_line":"            return"},{"line_number":1114,"context_line":"        if not fixed_ip.leased:"}],"source_content_type":"text/x-python","patch_set":3,"id":"fa32b979_a841ad64","line":1111,"updated":"2015-06-25 14:28:02.000000000","message":"ditto","commit_id":"8c7690221294d6d7f2db84491fec8d81ef358cac"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"ade8d96b0df32a686afa9754f8d842e64d19e53a","unresolved":false,"context_lines":[{"line_number":1112,"context_line":"                        context\u003dcontext)"},{"line_number":1113,"context_line":"            return"},{"line_number":1114,"context_line":"        if not fixed_ip.leased:"},{"line_number":1115,"context_line":"            LOG.warning(_LW(\u0027IP %s released that was not leased\u0027), address,"},{"line_number":1116,"context_line":"                        context\u003dcontext, instance_uuid\u003dfixed_ip.instance_uuid)"},{"line_number":1117,"context_line":"        else:"},{"line_number":1118,"context_line":"            fixed_ip.leased \u003d False"}],"source_content_type":"text/x-python","patch_set":3,"id":"fa32b979_687965c7","line":1115,"updated":"2015-06-25 14:28:02.000000000","message":"can we add the mac here","commit_id":"8c7690221294d6d7f2db84491fec8d81ef358cac"},{"author":{"_account_id":9555,"name":"Matthew Booth","email":"mbooth@redhat.com","username":"MatthewBooth"},"change_message_id":"9da1bc61d85300a04a31659eba5d4d654aab99bd","unresolved":false,"context_lines":[{"line_number":1134,"context_line":"                                 \"in the process of allocating it\u0027s network.\"),"},{"line_number":1135,"context_line":"                             {\u0027address\u0027: address, \u0027mac\u0027: mac},"},{"line_number":1136,"context_line":"                             instance_uuid\u003dfixed_ip.instance_uuid)"},{"line_number":1137,"context_line":"                    return"},{"line_number":1138,"context_line":"            fixed_ip.disassociate()"},{"line_number":1139,"context_line":""},{"line_number":1140,"context_line":"    @staticmethod"}],"source_content_type":"text/x-python","patch_set":3,"id":"fa32b979_03099a94","line":1137,"updated":"2015-06-25 15:01:24.000000000","message":"This doesn\u0027t really fix the race; it just makes it shorter. While this is obviously a big improvement, I don\u0027t think it should be too hard to fix this properly. The outline of the fix would be to pass the received mac address to fixed_ip.disassociate(), which would in turn pass it to db.sqlalchemy.api.fixed_ip_disassociate().\n\nIt gets slightly complex at this point because mac address isn\u0027t directly a property of fixed_ip, but it is still possible to do an atomic compare and swap of a joined table. Unfortunately the syntaxes of MySQL and PostgreSQL are entirely different in this regard, and sqlalchemy isn\u0027t (or at least wasn\u0027t the last time I looked) sufficiently alchemical to abstract them. In essence, see here:\n\nhttp://stackoverflow.com/questions/2446764/oracle-update-statement-with-inner-join\n\nIIRC PostgreSQL uses the Oracle sytax, MySQL uses the inner join syntax. Neither db supports both syntaxes.","commit_id":"8c7690221294d6d7f2db84491fec8d81ef358cac"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"90182c12663e27a61a8ef86ca1d87f051eb169b0","unresolved":false,"context_lines":[{"line_number":1134,"context_line":"                                 \"in the process of allocating it\u0027s network.\"),"},{"line_number":1135,"context_line":"                             {\u0027address\u0027: address, \u0027mac\u0027: mac},"},{"line_number":1136,"context_line":"                             instance_uuid\u003dfixed_ip.instance_uuid)"},{"line_number":1137,"context_line":"                    return"},{"line_number":1138,"context_line":"            fixed_ip.disassociate()"},{"line_number":1139,"context_line":""},{"line_number":1140,"context_line":"    @staticmethod"}],"source_content_type":"text/x-python","patch_set":3,"id":"fa32b979_6bcf1158","line":1137,"in_reply_to":"fa32b979_03099a94","updated":"2015-06-25 19:47:49.000000000","message":"I was also going to just update the fixed_ip.associate object (rpc api) and db api calls to pass in the vif if there is one, and set the allocated flag to True in the db api when doing the associate with the instance, that would also lock this down further.","commit_id":"8c7690221294d6d7f2db84491fec8d81ef358cac"}]}
