)]}'
{"nova/compute/manager.py":[{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"fe2f467a52eb0e83f65b7f1745cd27d0ab25acff","unresolved":false,"context_lines":[{"line_number":4773,"context_line":"        network_info \u003d self.network_api.allocate_port_for_instance("},{"line_number":4774,"context_line":"            context, instance, port_id, network_id, requested_ip)"},{"line_number":4775,"context_line":""},{"line_number":4776,"context_line":"        try:"},{"line_number":4777,"context_line":"            if len(network_info) !\u003d 1:"},{"line_number":4778,"context_line":"                LOG.error(_LE(\u0027allocate_port_for_instance returned %(ports)s \u0027"},{"line_number":4779,"context_line":"                              \u0027ports\u0027), dict(ports\u003dlen(network_info)))"}],"source_content_type":"text/x-python","patch_set":1,"id":"7a8c0949_805ec974","line":4776,"updated":"2014-11-05 19:21:56.000000000","message":"the try should be on line 4783\nin addition to this i think that there may be a problem if get_image_metadata throws an exception, that is, we may be calling deallocate_port_for_instance and the actual port was not allocated","commit_id":"2884f7efe58e0a922c63e75c4c83b22294e9e961"},{"author":{"_account_id":12175,"name":"Eli Qiao","email":"qiaoliyong@gmail.com","username":"Eli"},"change_message_id":"901febe32d83e7f8ad46431327fb0740f2519355","unresolved":false,"context_lines":[{"line_number":4773,"context_line":"        network_info \u003d self.network_api.allocate_port_for_instance("},{"line_number":4774,"context_line":"            context, instance, port_id, network_id, requested_ip)"},{"line_number":4775,"context_line":""},{"line_number":4776,"context_line":"        try:"},{"line_number":4777,"context_line":"            if len(network_info) !\u003d 1:"},{"line_number":4778,"context_line":"                LOG.error(_LE(\u0027allocate_port_for_instance returned %(ports)s \u0027"},{"line_number":4779,"context_line":"                              \u0027ports\u0027), dict(ports\u003dlen(network_info)))"}],"source_content_type":"text/x-python","patch_set":1,"id":"7a8c0949_8d5a814e","line":4776,"in_reply_to":"7a8c0949_805ec974","updated":"2014-11-06 01:48:30.000000000","message":"hi garyk,\nthe port(s) has been allocated at line 4773 already.\nif we don\u0027t handle the exception in 4780, the port(s) will leak..\nshould call deallocate_port_for_instance to clean up these port(s)","commit_id":"2884f7efe58e0a922c63e75c4c83b22294e9e961"},{"author":{"_account_id":2750,"name":"Sean Dague","email":"sean@dague.net","username":"sdague"},"change_message_id":"a3dd063f0c80d13007cc396aba87fad7ca9ddeee","unresolved":false,"context_lines":[{"line_number":4815,"context_line":"                         requested_ip):"},{"line_number":4816,"context_line":"        \"\"\"Use hotplug to add an network adapter to an instance.\"\"\""},{"line_number":4817,"context_line":"        network_info \u003d self.network_api.allocate_port_for_instance("},{"line_number":4818,"context_line":"            context, instance, port_id, network_id, requested_ip)"},{"line_number":4819,"context_line":"        image_ref \u003d instance.get(\u0027image_ref\u0027)"},{"line_number":4820,"context_line":"        image_meta \u003d compute_utils.get_image_metadata("},{"line_number":4821,"context_line":"            context, self.image_api, image_ref, instance)"}],"source_content_type":"text/x-python","patch_set":6,"id":"da86d52c_5a318f58","line":4818,"updated":"2015-02-06 12:32:32.000000000","message":"I\u0027m actually not sure why we are doing error handling here, vs. having allocate_port_for_instance just not ever return \u003e 1 network_info (and throw an exception if it does). It seems like trying to unwind everything this high up is kind of wonky.","commit_id":"577aa1be8837fd48d23a4efbfb184eb132bdcedf"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"5a4b820d51eef8fe3427dd19f4c17ef33b72c92f","unresolved":false,"context_lines":[{"line_number":4644,"context_line":"        \"\"\"Use hotplug to add an network adapter to an instance.\"\"\""},{"line_number":4645,"context_line":"        network_info \u003d self.network_api.allocate_port_for_instance("},{"line_number":4646,"context_line":"            context, instance, port_id, network_id, requested_ip)"},{"line_number":4647,"context_line":"        if len(network_info) !\u003d 1:"},{"line_number":4648,"context_line":"            LOG.error(_LE(\u0027allocate_port_for_instance returned %(ports)s \u0027"},{"line_number":4649,"context_line":"                          \u0027ports\u0027), {\u0027ports\u0027: len(network_info)})"},{"line_number":4650,"context_line":"            raise exception.InterfaceAttachFailed("}],"source_content_type":"text/x-python","patch_set":10,"id":"fa1b9901_70780ac5","side":"PARENT","line":4647,"updated":"2015-08-18 18:33:18.000000000","message":"I am not sure we should remove this without adding the handling of that into the network_api?\n\nAt least I think thats what sean was getting at with his comments, not to remove this check.","commit_id":"b873badc0b60a3bf53cac03a6e220d151953911b"},{"author":{"_account_id":12175,"name":"Eli Qiao","email":"qiaoliyong@gmail.com","username":"Eli"},"change_message_id":"7ce1b17d5bbc1474a7c07aa7180ff94d1c1b8deb","unresolved":false,"context_lines":[{"line_number":4644,"context_line":"        \"\"\"Use hotplug to add an network adapter to an instance.\"\"\""},{"line_number":4645,"context_line":"        network_info \u003d self.network_api.allocate_port_for_instance("},{"line_number":4646,"context_line":"            context, instance, port_id, network_id, requested_ip)"},{"line_number":4647,"context_line":"        if len(network_info) !\u003d 1:"},{"line_number":4648,"context_line":"            LOG.error(_LE(\u0027allocate_port_for_instance returned %(ports)s \u0027"},{"line_number":4649,"context_line":"                          \u0027ports\u0027), {\u0027ports\u0027: len(network_info)})"},{"line_number":4650,"context_line":"            raise exception.InterfaceAttachFailed("}],"source_content_type":"text/x-python","patch_set":10,"id":"fa1b9901_edd74d21","side":"PARENT","line":4647,"in_reply_to":"fa1b9901_70780ac5","updated":"2015-08-19 05:51:34.000000000","message":"hi John, I think we can remove this check because network_api.allocate_port_for_instanc won\u0027t return a network_info which length \u003e 1, it will raise exception instead of return anything.\n\nso if allocate_port_for_instance return without any exception, then the length of network_info should be 1.\n\nanother point is if we call network_api to require a new port(if hit this check), then we simple raise a exception without release the port, ports will get leak..\n\nEli.","commit_id":"b873badc0b60a3bf53cac03a6e220d151953911b"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"23b80850f7d9f9d0bb9d249ebe888f3e485c6905","unresolved":false,"context_lines":[{"line_number":4644,"context_line":"        \"\"\"Use hotplug to add an network adapter to an instance.\"\"\""},{"line_number":4645,"context_line":"        network_info \u003d self.network_api.allocate_port_for_instance("},{"line_number":4646,"context_line":"            context, instance, port_id, network_id, requested_ip)"},{"line_number":4647,"context_line":"        if len(network_info) !\u003d 1:"},{"line_number":4648,"context_line":"            LOG.error(_LE(\u0027allocate_port_for_instance returned %(ports)s \u0027"},{"line_number":4649,"context_line":"                          \u0027ports\u0027), {\u0027ports\u0027: len(network_info)})"},{"line_number":4650,"context_line":"            raise exception.InterfaceAttachFailed("}],"source_content_type":"text/x-python","patch_set":10,"id":"da6ed579_6beee2b5","side":"PARENT","line":4647,"in_reply_to":"fa1b9901_edd74d21","updated":"2016-01-13 10:06:44.000000000","message":"I don\u0027t see the check in here for nova-network:\nhttps://github.com/openstack/nova/blob/master/nova/network/manager.py#L514\n\nAh, thanks for the note on IRC, I see we do have a check in neutron:\nhttps://github.com/openstack/nova/blob/master/nova/network/neutronv2/api.py#L574\n\nAlthough I am not sure 100% sure its quite the same, incase a port doesn\u0027t get created, and everything gets gets filtered out at the end, somehow:\nhttps://github.com/openstack/nova/blob/master/nova/network/neutronv2/api.py#L657","commit_id":"b873badc0b60a3bf53cac03a6e220d151953911b"}]}
